Should i add some character/s before or after < character (which is in string i'm trying to extract something from - it's html page) when doing preg match?
+1
A:
you dont need to escape < unless you are saving a user generated data and then you should be concerned about security and XSS.
Mohammad
2009-09-30 16:17:05
thanks for the down vote :) I guess that's what I should expect for answering such questions!
Mohammad
2009-09-30 16:22:27
There appear to be some people here who are down vote trigger happy. Luckily a few up votes erases the damage from a down ;)
Daniel Bingham
2009-09-30 16:31:31
true that. :) cheers.
Mohammad
2009-09-30 16:35:13
+6
A:
you don't need to escape it, it's not a special character in regexes.
SilentGhost
2009-09-30 16:17:38
+2
A:
Some regex parsers treat the "<" and ">" symbols as the word boundaries (GNU Basic & Extended regular expressions). See this great site for all regex-related info.
Yurik
2009-09-30 16:41:55