Moderator: General Moderators
One last thing before we build our first regex. Regex needs to be delimited if using Perl style regular expressions (preg_match()) which I strongly advise you do (Note: ereg_...() is not perl style).
To delimit a regex we start and end with the EXACT same character. The two standards are (but you can use most non-alphanumeric characters):
Code:
/pattern/
#pattern#
The Ninja Space Goat wrote:Why does it have to be delimited? What does that mean?
To delimit a regex we start and end with the EXACT same character. The two standards are (but you can use most non-alphanumeric characters):
Code:
/pattern/
#pattern#
Shendemiar wrote:I think it was not mentioned, that PHP itself, needs to escape few characters as well, like the Regexp escape character \ or ", with the php escape char: (also) \
yacahuma wrote:This is an excellent tutorial.
[url]
http://www.webcheatsheet.com/php/regula ... ssions.php
[/url]
Users browsing this forum: No registered users and 1 guest