
vijayneedshelp
New User
Jul 12, 2011, 12:13 AM
Post #2 of 3
(1602 views)
|
Re: [vijayneedshelp] Regular expression foo
[In reply to]
|
Can't Post
|
|
Oh wow, I think I figured it out! 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!
|