note 21027 deleted from pcre.pattern.syntax by sp
| From: | sp@php.net | Date: | Sun, 15 Jun 2003 10:57:55 +0000 |
| Subject: | note 21027 deleted from pcre.pattern.syntax by sp | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-50371@lists.php.net to get a copy of this message | ||
Note Submitter: php@NOSPAMmarsorange.com
----
Backreferences in PHP PERC regex match patterns should be prefixed with TWO backslashes, not ONE
like this documentation says.
This will NEVER match a quoted string:
{(\"|').*?\1}msi
This will ALWAYS match a quoted string:
{(\"|').*?\\1}msi
I hope this prevents someone else the hours of troubleshooting it caused me!
Mars :)