05-15-2008, 02:14 PM
|
#2 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
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!): [_a-z\d\-\\\\\/]
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: ~test://~ vs /test:\/\//
|
|
|
|