Jul 12, 2011, 12:13 AM
Post #2 of 3
Oh wow, I think I figured it out!
Re: [vijayneedshelp] Regular expression foo
[In reply to]
When you put a pattern in a string and use it as a regular expression, you need to double escape certain things.
Like if I want a literal match to the ? character I can't do:
$pattern = "\?";
I should do:
$pattern = "\\?";
That stumped me for ages!