- - preg_match problem
||05-15-2008 01:21 PM
When I run this expression in preg_match is returns
: preg_match() [function.preg-match]: Unknown modifier ']' in /home/img911/public_html/url/shorten.php on line 16
The expression is
||05-15-2008 02:14 PM
The problem lies in the final character class definition
[_a-z\d\-\\\/], the escaping back slashes cause it. They're interpreted (by the PHP parser) to be
\\/ which the regex parser decides is a single backslash followed by a forward slash, the pattern delimiter. To match a backslash, you'll need four consecutive backslashes (plus 1 escaping the forward slash!):
It might also make life easier if you use a different delimiter for the pattern, which would save you having to escape all of those forward slashes:
|All times are GMT. The time now is 11:21 PM.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0