note 84798 modified in function.preg-quote by yannick

From: Date: Thu, 07 Aug 2008 13:52:38 +0000
Subject: note 84798 modified in function.preg-quote by yannick
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-143271@lists.php.net to get a copy of this message
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... --was-- 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 preg_match('foo/bar/',$somevar); ?> it's that simple! like this, you won't have to bother with delimiters anymore... http://php.net/manual/en/function.preg-quote.php

« previous php.notes (#143271) next »