[thelist] PHP REg Exp

Fred Jones fredthejonester at gmail.com
Tue Dec 18 09:06:20 CST 2007


> As you say . matches everything but newlines. However there's a set
> of pattern modifiers that change this, and other, behaviours of the
> regular expression:
> 
> http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php
> 
> So, if you instead use this pattern:
> 
> /(.*)__START_STYLE__(.*)__END_STYLE__(.*)/s
> 
> ( note the trailing s )

Brilliant! Perfect!

Thank you very much. :)

Fred

<tip type="PHP" author="Fred Jones">
Interesting read here:

http://shiflett.org/blog/2006/jan/addslashes-versus-mysql-real-escape-string

about "addslashes() Versus mysql_real_escape_string()"
</tip>



More information about the thelist mailing list