[pmwiki-devel] Quick preg_replace question...

Jason Frisvold xenophage0 at gmail.com
Fri Apr 27 09:27:01 CDT 2007


On 4/27/07, Hans <design5 at softflow.co.uk> wrote:
> Thank you for the advise about \s etc.
> There is a lot for me to be learned with regex, and detailed
> explanations are very valuable lessons!

While it doesn't pertain specifically to this conversation, you also
need to watch out for the $ metacharacter.  It matches more than just
the end of the line, based on what flags you're setting in the regex..
 You can read more about it at Stefan Esser's blog [1] and at my blog
[2], although my blog entry is based on Stefan's...

> Hans

[1] http://blog.php-security.org/archives/76-Holes-in-most-preg_match-filters.html
[2] http://blog.godshell.com/blog/index.php?/archives/93-Common-PHP-Regular-Expression-Security-Issue.html
-- 
Jason 'XenoPhage' Frisvold
XenoPhage0 at gmail.com
http://blog.godshell.com



More information about the pmwiki-devel mailing list