From a22938b1300716e52a216a98d67de83931716f9a Mon Sep 17 00:00:00 2001 From: Brian Moon Date: Wed, 19 Jul 2000 15:02:02 +0000 Subject: [PATCH] fixed bad definition of preg_quote. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@28622 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/pcre.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/functions/pcre.xml b/functions/pcre.xml index 9e939aa451..87862f6eb4 100644 --- a/functions/pcre.xml +++ b/functions/pcre.xml @@ -388,6 +388,7 @@ $keywords = preg_split ("/[\s,]+/", "hypertext language, programming"); string preg_quote string str + string delimiter @@ -397,10 +398,25 @@ $keywords = preg_split ("/[\s,]+/", "hypertext language, programming"); run-time string that you need to match in some text and the string may contain special regex characters. + + If the optional delimiter is specified, it + will also be escaped. This is useful for escaping the delimeter + that is required by the PCRE functions. The / is the most commonly + used delimiter. The special regular expression characters are: . \\ + * ? [ ^ ] $ ( ) { } = ! < > | : + + + Examples: + +$keywords="$40 for a g3/400"; +$keywords = preg_quote ($keywords, "/"); +echo $keywords; // returns \$40 for a g3\/400 + + +