From c4a4fa48cf7bf7330125f1be3c587aab4f47b88d Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Tue, 6 Jan 2004 09:14:39 +0000 Subject: [PATCH] Document new flags, parameters. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@147954 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/pcre/functions/preg-grep.xml | 22 ++++++++++++++++++++- reference/pcre/functions/preg-match-all.xml | 16 +++++++++++++-- reference/pcre/functions/preg-match.xml | 17 +++++++++++++--- 3 files changed, 49 insertions(+), 6 deletions(-) diff --git a/reference/pcre/functions/preg-grep.xml b/reference/pcre/functions/preg-grep.xml index 8628686128..b0c4420abb 100644 --- a/reference/pcre/functions/preg-grep.xml +++ b/reference/pcre/functions/preg-grep.xml @@ -1,5 +1,5 @@ - + @@ -14,6 +14,7 @@ arraypreg_grep stringpattern arrayinput + intflags @@ -21,6 +22,25 @@ the elements of the input array that match the given pattern. + + + flags can be the following flag: + + + PREG_GREP_INVERT + + + If this flag is passed, preg_grep returns the + elements of the input array that do not match + the given pattern. + This flag is available since PHP 4.2.0. + + + + + The flags parameter is available since + PHP 4.3.0. + Since PHP 4.0.4, the results returned by preg_grep diff --git a/reference/pcre/functions/preg-match-all.xml b/reference/pcre/functions/preg-match-all.xml index 0d45be49f1..dddd1fc00b 100644 --- a/reference/pcre/functions/preg-match-all.xml +++ b/reference/pcre/functions/preg-match-all.xml @@ -1,5 +1,5 @@ - + @@ -14,6 +14,7 @@ stringsubject arraymatches intflags + intoffset Searches subject for all matches to the regular @@ -111,7 +112,7 @@ echo $out[1][0] . ", " . $out[1][1] . "\n"; PREG_OFFSET_CAPTURE - If this flag is set, for every occurring match the appendant string + If this flag is passed, for every occurring match the appendant string offset will also be returned. Note that this changes the return value in an array where every element is an array consisting of the matched string at offset 0 and it's string offset @@ -126,6 +127,17 @@ echo $out[1][0] . ", " . $out[1][1] . "\n"; If no order flag is given, PREG_PATTERN_ORDER is assumed. + + + Normally, the search starts from the beginning of the subject string. The + optional parameter offset can be used to specify + the alternate place from which to start the search. It is equivalent to + passing substr($subject, $offset) to + preg_match in place of the subject string. + The offset parameter is available since + PHP 4.3.3. + + Returns the number of full pattern matches (which might be zero), or &false; if an error occurred. diff --git a/reference/pcre/functions/preg-match.xml b/reference/pcre/functions/preg-match.xml index b654c34c17..72ba87e046 100644 --- a/reference/pcre/functions/preg-match.xml +++ b/reference/pcre/functions/preg-match.xml @@ -1,5 +1,5 @@ - + @@ -14,6 +14,7 @@ stringsubject arraymatches intflags + intoffset Searches subject for a match to the regular @@ -33,7 +34,7 @@ PREG_OFFSET_CAPTURE - If this flag is set, for every occurring match the appendant string + If this flag is passed, for every occurring match the appendant string offset will also be returned. Note that this changes the return value in an array where every element is an array consisting of the matched string at offset 0 and it's string offset into @@ -44,7 +45,17 @@ The flags parameter is available since - PHP 4.3.0 . + PHP 4.3.0. + + + + Normally, the search starts from the beginning of the subject string. The + optional parameter offset can be used to specify + the alternate place from which to start the search. It is equivalent to + passing substr($subject, $offset) to + preg_match in place of the subject string. + The offset parameter is available since + PHP 4.3.3.