Document new flags, parameters.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@147954 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Andrei Zmievski 2004-01-06 09:14:39 +00:00
parent 384d164594
commit c4a4fa48cf
3 changed files with 49 additions and 6 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/pcre.xml, last change in rev 1.2 -->
<refentry id="function.preg-grep">
<refnamediv>
@ -14,6 +14,7 @@
<type>array</type><methodname>preg_grep</methodname>
<methodparam><type>string</type><parameter>pattern</parameter></methodparam>
<methodparam><type>array</type><parameter>input</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
</methodsynopsis>
<para>
@ -21,6 +22,25 @@
the elements of the <parameter>input</parameter> array that match
the given <parameter>pattern</parameter>.
</para>
<para>
<parameter>flags</parameter> can be the following flag:
<variablelist>
<varlistentry>
<term>PREG_GREP_INVERT</term>
<listitem>
<simpara>
If this flag is passed, <function>preg_grep</function> returns the
elements of the input array that do <emphasis>not</emphasis> match
the given <parameter>pattern</parameter>.
This flag is available since <literal>PHP</literal> 4.2.0.
</simpara>
</listitem>
</varlistentry>
</variablelist>
The <parameter>flags</parameter> parameter is available since
<literal>PHP</literal> 4.3.0.
</para>
<para>
Since PHP 4.0.4, the results returned by <function>preg_grep</function>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.10 $ -->
<!-- $Revision: 1.11 $ -->
<!-- splitted from ./en/functions/pcre.xml, last change in rev 1.2 -->
<refentry id="function.preg-match-all">
<refnamediv>
@ -14,6 +14,7 @@
<methodparam><type>string</type><parameter>subject</parameter></methodparam>
<methodparam><type>array</type><parameter>matches</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam>
</methodsynopsis>
<para>
Searches <parameter>subject</parameter> for all matches to the regular
@ -111,7 +112,7 @@ echo $out[1][0] . ", " . $out[1][1] . "\n";
<term>PREG_OFFSET_CAPTURE</term>
<listitem>
<para>
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 <literal>0</literal> and it's string offset
@ -126,6 +127,17 @@ echo $out[1][0] . ", " . $out[1][1] . "\n";
If no order flag is given, <constant>PREG_PATTERN_ORDER</constant> is
assumed.
</para>
<para>
Normally, the search starts from the beginning of the subject string. The
optional parameter <parameter>offset</parameter> can be used to specify
the alternate place from which to start the search. It is equivalent to
passing <function>substr</function>($subject, $offset) to
<function>preg_match</function> in place of the subject string.
The <parameter>offset</parameter> parameter is available since
<literal>PHP</literal> 4.3.3.
</para>
<para>
Returns the number of full pattern matches (which might be zero),
or &false; if an error occurred.

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.10 $ -->
<!-- $Revision: 1.11 $ -->
<!-- splitted from ./en/functions/pcre.xml, last change in rev 1.2 -->
<refentry id="function.preg-match">
<refnamediv>
@ -14,6 +14,7 @@
<methodparam><type>string</type><parameter>subject</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>matches</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam>
</methodsynopsis>
<para>
Searches <parameter>subject</parameter> for a match to the regular
@ -33,7 +34,7 @@
<term>PREG_OFFSET_CAPTURE</term>
<listitem>
<simpara>
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 <literal>0</literal> and it's string offset into
@ -44,7 +45,17 @@
</varlistentry>
</variablelist>
The <parameter>flags</parameter> parameter is available since
<literal>PHP</literal> 4.3.0 .
<literal>PHP</literal> 4.3.0.
</para>
<para>
Normally, the search starts from the beginning of the subject string. The
optional parameter <parameter>offset</parameter> can be used to specify
the alternate place from which to start the search. It is equivalent to
passing <function>substr</function>($subject, $offset) to
<function>preg_match</function> in place of the subject string.
The <parameter>offset</parameter> parameter is available since
<literal>PHP</literal> 4.3.3.
</para>
<para>