#5 Use preg_quote() instead?

open
nobody
None
5
2009-10-30
2009-10-30
No

I'm wondering why some of the functions manually quote meta characters in the regex rather than using preg_quote()?

//quote charlist for use in a characterclass
$charlist = preg_replace('!([\\\\\\-\\]\\[/^])!','\\\${1}',$charlist);

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks