note 4326 deleted from function.preg-match by sniper
| From: | sniper@php.net | Date: | Fri, 17 Oct 2003 03:28:35 +0000 |
| Subject: | note 4326 deleted from function.preg-match by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-58729@lists.php.net to get a copy of this message | ||
Note Submitter: chrisbolt@home.com
----
If you want to use some of PHP's special characters in your expression, such as $, you must
escape it twice. For example:
$matchme = "\$example";
if (preg_match("/\$example/", $matchme)) {
will not be matched because PHP interprets the \$ and passes it as $. Instead, you must do this:
if (preg_match("/\\\$example/", $matchme)) {