note 84798 deleted from function.preg-quote by cmb
| From: | cmb@php.net | Date: | Sat, 20 Aug 2016 12:44:43 +0000 |
| Subject: | note 84798 deleted from function.preg-quote by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-206343@lists.php.net to get a copy of this message | ||
Note Submitter: bizzigul at hotmail dot fr
----
To prevent any problems, try to always use a delimiter that will *almost* not be used inside the
regex, such as ` (back quote)
for example: instead of
<?php preg_match('/foo\/bar\//',$somevar); ?>
use
<?php preg_match('
foo/bar/',$somevar); ?>
it's that simple! like this, you won't have to bother with delimiters anymore...