Modifiers in regular expression patterns
We all like regex patterns, because it’s a great way to select, filter or replace strings, numbers or complete code blocks. How about PCRE modifiers, do you use them very often? A few weeks ago I need to use one because I get in trouble with line breaks in some string, I needed to select in some transaction. I will show in this article some examples with the “most important” PCRE modifiers.
Note each modifier is responsible for the whole pattern!
Upper and lowercase letters
Using and “i” will match both upper and lowercase letters. Use '/[a-z]*/i' to match those strings.
Match patterns across multiple lines
Normally a regex test ends at end of each line, using the “m” modifier the string is processed until the end is reached, example:
Read the rest of this entry »
Latest Articles
- Image manipulations with Imagemagick
- .tel domain launch, the next mobile story
- A new Wordpress theme for our blog
- AdSense for Domains, just another Domain Parking Service?
- Count clicks the right way!
- Curl: Location redirect while open_basedir is set
- Don't trust your own websites!
- Just a better Internet portal provided by Google
- Upload images for usage in TinyMCE
- In-Text Advertisements: Publisher Review


