Zend Studio for Eclipse is giving me this error:
Multiple annotations found at this line:
- bad-escape : Bad escape sequence: \/, did you
mean \\/?
- bad-escape : Bad escape sequence: \/, did you
mean \\/?
This is my code:
if(preg_match("/\/(.*)\/public/i", $this->_request->__get('REQUEST_URI'), $matches))
It works fine, and if I add another backslash, it still works fine. Why is it giving me this error?
preg_match error in Zend Studio for Eclipse
Moderator: General Moderators
- prometheuzz
- Forum Regular
- Posts: 779
- Joined: Fri Apr 04, 2008 5:51 am
Re: preg_match error in Zend Studio for Eclipse
Syntactically, that regex pattern is fine, as you might have guessed yourself since all worked just fine.
In order to get rid of that error, you might try to use different delimiters so that the Zend framework perhaps will not complain:
in which case you need not escape the slashes.
HTH.
In order to get rid of that error, you might try to use different delimiters so that the Zend framework perhaps will not complain:
Code: Select all
if(preg_match("#/(.*)/public#i", $this->_request->__get('REQUEST_URI'), $matches))HTH.