cvs: phpdoc /en/reference/spl iterators.xml regexiterator.xml /en/reference/spl/regexiterator construct.xml getflags.xml getmode.xml getpregflags.xml
setflags.xml setmode.xml setpregflags.xml

From: Date: Sat, 04 Jul 2009 13:40:46 +0000
Subject: cvs: phpdoc /en/reference/spl iterators.xml regexiterator.xml /en/reference/spl/regexiterator construct.xml getflags.xml getmode.xml getpregflags.xml
setflags.xml setmode.xml setpregflags.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-4329@lists.php.net to get a copy of this message
joris Sat Jul 4 13:40:46 2009 UTC Added files: /phpdoc/en/reference/spl regexiterator.xml /phpdoc/en/reference/spl/regexiterator getmode.xml getpregflags.xml construct.xml setmode.xml getflags.xml setflags.xml setpregflags.xml Modified files: /phpdoc/en/reference/spl iterators.xml Log: Added documentation and examples for RegexIterator class.

http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/iterators.xml?r1=1.9&r2=1.10&diff_format=u Index: phpdoc/en/reference/spl/iterators.xml diff -u phpdoc/en/reference/spl/iterators.xml:1.9 phpdoc/en/reference/spl/iterators.xml:1.10 --- phpdoc/en/reference/spl/iterators.xml:1.9 Fri Jul 3 18:53:19 2009 +++ phpdoc/en/reference/spl/iterators.xml Sat Jul 4 13:40:46 2009 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- $Revision: 1.9 $ --> +<!-- $Revision: 1.10 $ --> <part xml:id="spl.iterators" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> @@ -17,7 +17,6 @@ <member><classname>RecursiveFilterIterator</classname></member> <member><classname>RecursiveRegexIterator</classname></member> <member><classname>RecursiveTreeIterator</classname></member> - <member><classname>RegexIterator</classname></member> </simplelist> </section> @@ -28,7 +27,6 @@ &reference.spl.recursivefilteriterator; &reference.spl.recursiveregexiterator; &reference.spl.recursivetreeiterator; - &reference.spl.regexiterator; --> &reference.spl.appenditerator; @@ -48,6 +46,7 @@ &reference.spl.recursivecachingiterator; &reference.spl.recursivedirectoryiterator; &reference.spl.recursiveiteratoriterator; + &reference.spl.regexiterator; &reference.spl.simplexmliterator; </part> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/regexiterator.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/spl/regexiterator.xml +++ phpdoc/en/reference/spl/regexiterator.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <phpdoc:classref xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="class.regexiterator" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude"> <title>The RegexIterator class</title> <titleabbrev></titleabbrev> <partintro> <!-- {{{ intro --> <section xml:id="regexiterator.intro"> &reftitle.intro; <para> This iterator can be used to filter another iterator via a regular expression. </para> </section> <!-- }}} --> <section xml:id="regexiterator.synopsis"> &reftitle.classsynopsis; <!-- {{{ Synopsis --> <classsynopsis> <ooclass><classname>RegexIterator</classname></ooclass> <!-- {{{ Class synopsis --> <classsynopsisinfo> <ooclass> <classname>RegexIterator</classname> </ooclass> <ooclass> <modifier>extends</modifier> <classname>FilterIterator</classname> </ooclass> </classsynopsisinfo> <classsynopsisinfo role="comment">Constants</classsynopsisinfo> <fieldsynopsis> <modifier>const</modifier> <type>integer</type> <varname linkend="regexiterator.constants.match">MATCH</varname> <initializer>0</initializer> </fieldsynopsis> <fieldsynopsis> <modifier>const</modifier> <type>integer</type> <varname linkend="regexiterator.constants.get-match">GET_MATCH</varname> <initializer>1</initializer> </fieldsynopsis> <fieldsynopsis> <modifier>const</modifier> <type>integer</type> <varname linkend="regexiterator.constants.all-matches">ALL_MATCHES</varname> <initializer>2</initializer> </fieldsynopsis> <fieldsynopsis> <modifier>const</modifier> <type>integer</type> <varname linkend="regexiterator.constants.split">SPLIT</varname> <initializer>3</initializer> </fieldsynopsis> <fieldsynopsis> <modifier>const</modifier> <type>integer</type> <varname linkend="regexiterator.constants.replace">REPLACE</varname> <initializer>4</initializer> </fieldsynopsis> <fieldsynopsis> <modifier>const</modifier> <type>integer</type> <varname linkend="regexiterator.constants.use-key">USE_KEY</varname> <initializer>1</initializer> </fieldsynopsis> <!-- }}} --> <!-- {{{ If the property is documented below (xml:id=regexiterator.props) use this <classsynopsisinfo role="comment">Properties</classsynopsisinfo> <fieldsynopsis> <modifier>public</modifier> <type>string</type> <varname linkend="regexiterator.props.name">name</varname> </fieldsynopsis> }}} --> <classsynopsisinfo role="comment">Methods</classsynopsisinfo> <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.regexiterator')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[1])" /> <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.regexiterator')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" /> <classsynopsisinfo role="comment">Inherited methods</classsynopsisinfo> <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.filteriterator')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" /> </classsynopsis> </section> <section xml:id="regexiterator.constants"> &reftitle.constants; <section xml:id="regexiterator.constants.operation-modes"> <title>RegexIterator operation modes</title> <variablelist> <varlistentry xml:id="regexiterator.constants.all-matches"> <term><constant>RegexIterator::ALL_MATCHES</constant></term> <listitem> <para>Return all matches for the current entry (see <function>preg_match_all</function>).</para> </listitem> </varlistentry> <varlistentry xml:id="regexiterator.constants.get-match"> <term><constant>RegexIterator::GET_MATCH</constant></term> <listitem> <para>Return the first match for the current entry (see <function>preg_match</function>).</para> </listitem> </varlistentry> <varlistentry xml:id="regexiterator.constants.match"> <term><constant>RegexIterator::MATCH</constant></term> <listitem> <para>Only execute match (filter) for the current entry (see <function>preg_match</function>).</para> </listitem> </varlistentry> <varlistentry xml:id="regexiterator.constants.replace"> <term><constant>RegexIterator::REPLACE</constant></term> <listitem> <para>Replace the current entry or the current key (see <function>preg_replace</function>).</para> </listitem> </varlistentry> <varlistentry xml:id="regexiterator.constants.split"> <term><constant>RegexIterator::SPLIT</constant></term> <listitem> <para>Returns the split values for the current entry (see <function>preg_split</function>).</para> </listitem> </varlistentry> </variablelist> </section> <section xml:id="regexiterator.constants.flags"> <title>RegexIterator Flags</title> <variablelist> <varlistentry xml:id="regexiterator.constants.use-key"> <term><constant>RegexIterator::USE_KEY</constant></term> <listitem> <para>Special flag: Match the entry key instead of the entry valye.</para> </listitem> </varlistentry> </variablelist> </section> </section> <!-- {{{ properties <section xml:id="regexiterator.props"> &reftitle.properties; <variablelist> <varlistentry xml:id="regexiterator.props.name"> <term><varname>name</varname></term> <listitem> <para>Prop description</para> </listitem> </varlistentry> </variablelist> </section> }}} --> </partintro> &reference.spl.entities.regexiterator; </phpdoc:classref> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/regexiterator/getmode.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/spl/regexiterator/getmode.xml +++ phpdoc/en/reference/spl/regexiterator/getmode.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="regexiterator.getmode" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>RegexIterator::getMode</refname> <refpurpose>Returns operation mode.</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <!-- Example: All methods have this --> <type>int</type><methodname>RegexIterator::getMode</methodname> <void /> </methodsynopsis> <para> Returns the operation mode, see <methodname>RegexIterator::setMode</methodname> for the list of operation modes. </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the operation mode. </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>RegexIterator::setMode</function></member> </simplelist> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/regexiterator/getpregflags.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/spl/regexiterator/getpregflags.xml +++ phpdoc/en/reference/spl/regexiterator/getpregflags.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="regexiterator.getpregflags" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>RegexIterator::getPregFlags</refname> <refpurpose>Returns the regular expression flags.</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <!-- Example: All methods have this --> <type>int</type><methodname>RegexIterator::getPregFlags</methodname> <void /> </methodsynopsis> <para> Returns the special flags, see <methodname>RegexIterator::__construct</methodname> for the list of flags. </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the regular expression flags. </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>RegexIterator::setPregFlags</function></member> </simplelist> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/regexiterator/construct.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/spl/regexiterator/construct.xml +++ phpdoc/en/reference/spl/regexiterator/construct.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="regexiterator.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>RegexIterator::__construct</refname> <refpurpose>Creates a new RegexIterator.</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <constructorsynopsis> <methodname>RegexIterator::__construct</methodname> <methodparam><type>Iterator</type><parameter>iterator</parameter></methodparam> <methodparam><type>string</type><parameter>regex</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>mode</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>preg_flags</parameter></methodparam> </constructorsynopsis> <para> Creates a new regular expression iterator. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>iterator</parameter></term> <listitem> <para> The iterator to apply this regex filter to. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>regex</parameter></term> <listitem> <para> The regular expression to match. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>mode</parameter></term> <listitem> <para> Operation mode, see <methodname>RegexIterator::setMode</methodname> for a list of mode. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>flags</parameter></term> <listitem> <para> Special flags, see <methodname>RegexIterator::setFlags</methodname> for a list of available flags. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>preg_flags</parameter></term> <listitem> <para> The regular expression flags. These flags depend on the operation mode parameter: </para> <para> <table> <title><classname>RegexIterator</classname> preg_flags</title> <tgroup cols="2"> <thead> <row> <entry>operation mode</entry> <entry>available flags</entry> </row> </thead> <tbody> <row> <entry><varname linkend="regexiterator.constants.all-matches">RegexIterator::ALL_MATCHES</varname></entry> <entry> See <function>preg_match_all</function>. </entry> </row> <row> <entry><varname linkend="regexiterator.constants.get-match">RegexIterator::GET_MATCH</varname></entry> <entry> See <function>preg_match</function>. </entry> </row> <row> <entry><varname linkend="regexiterator.constants.match">RegexIterator::MATCH</varname></entry> <entry> See <function>preg_match</function>. </entry> </row> <row> <entry><varname linkend="regexiterator.constants.replace">RegexIterator::REPLACE</varname></entry> <entry> none. </entry> </row> <row> <entry><varname linkend="regexiterator.constants.split">RegexIterator::SPLIT</varname></entry> <entry> See <function>preg_split</function>. </entry> </row> </tbody> </tgroup> </table> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>RegexIterator::__construct</function> example</title> <para> Creates a new RegexIterator that filters all strings that start with 'test'. </para> <programlisting role="php"> <![CDATA[ <?php $arrayIterator = new ArrayIterator(array('test 1', 'another test', 'test 123')); $regexIterator = new RegexIterator($arrayIterator, '/^test/'); foreach ($regexIterator as $value) { echo $value . "\n"; } ?> ]]> </programlisting> &example.outputs.similar; <screen> <![CDATA[ test 1 test 123 ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>preg_match</function></member> <member><function>preg_match_all</function></member> <member><function>preg_replace</function></member> <member><function>preg_split</function></member> </simplelist> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/regexiterator/setmode.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/spl/regexiterator/setmode.xml +++ phpdoc/en/reference/spl/regexiterator/setmode.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="regexiterator.setmode" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>RegexIterator::setMode</refname> <refpurpose>Sets the operation mode.</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <!-- Example: All methods have this --> <type>void</type><methodname>RegexIterator::setMode</methodname> <methodparam><type>int</type><parameter>mode</parameter></methodparam> </methodsynopsis> <para> Sets the operation mode. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>mode</parameter></term> <listitem> <para> The operation mode. </para> <para> The available modes are listed below. The actual meanings of these modes are described in the <link linkend="regexiterator.constants">predefined constants</link>. <table> <title><classname>RegexIterator</classname> modes</title> <tgroup cols="2"> <thead> <row> <entry>value</entry> <entry>constant</entry> </row> </thead> <tbody> <row> <entry>0</entry> <entry> <link linkend="regexiterator.constants.match">RegexIterator::MATCH</link> </entry> </row> <row> <entry>1</entry> <entry> <link linkend="regexiterator.constants.get-match">RegexIterator::GET_MATCH</link> </entry> </row> <row> <entry>2</entry> <entry> <link linkend="regexiterator.constants.all-matches">RegexIterator::ALL_MATCHES</link> </entry> </row> <row> <entry>3</entry> <entry> <link linkend="regexiterator.constants.split">RegexIterator::SPLIT</link> </entry> </row> <row> <entry>4</entry> <entry> <link linkend="regexiterator.constants.replace">RegexIterator::REPLACE</link> </entry> </row> </tbody> </tgroup> </table> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.void; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>RegexIterator::setMode</function> example</title> <programlisting role="php"> <![CDATA[ <?php $test = array ('str1' => 'test 1', 'test str2' => 'another test', 'str3' => 'test 123'); $arrayIterator = new ArrayIterator($test); // Filter everything that starts with 'test ' followed by one or more numbers. $regexIterator = new RegexIterator($arrayIterator, '/^test (\d+)/'); // Operation mode: Replace actual value with the matches $regexIterator->setMode(RegexIterator::GET_MATCH); foreach ($regexIterator as $key => $value) { // print out the matched number(s) echo $key . ' => ' . $value[1] . "\n"; } ?> ]]> </programlisting> &example.outputs.similar; <screen> <![CDATA[ str1 => 1 str3 => 123 ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>RegexIterator::getMode</function></member> </simplelist> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/regexiterator/getflags.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/spl/regexiterator/getflags.xml +++ phpdoc/en/reference/spl/regexiterator/getflags.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="regexiterator.getflags" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>RegexIterator::getFlags</refname> <refpurpose>Returns the special flags.</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <!-- Example: All methods have this --> <type>int</type><methodname>RegexIterator::getFlags</methodname> <void /> </methodsynopsis> <para> Returns the special flags, see <methodname>RegexIterator::setFlags</methodname> for the list of special flags. </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the special flags. </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>RegexIterator::setFlags</function></member> </simplelist> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/regexiterator/setflags.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/spl/regexiterator/setflags.xml +++ phpdoc/en/reference/spl/regexiterator/setflags.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="regexiterator.setflags" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>RegexIterator::setFlags</refname> <refpurpose>Sets the special flags.</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <!-- Example: All methods have this --> <type>void</type><methodname>RegexIterator::setFlags</methodname> <methodparam><type>int</type><parameter>flags</parameter></methodparam> </methodsynopsis> <para> Sets the special flags. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>flags</parameter></term> <listitem> <para> The special flags. It takes a bitmask of class constants. </para> <para> The available flags are listed below. The actual meanings of these flags are described in the <link linkend="regexiterator.constants">predefined constants</link>. <table> <title><classname>RegexIterator</classname> special flags</title> <tgroup cols="2"> <thead> <row> <entry>value</entry> <entry>constant</entry> </row> </thead> <tbody> <row> <entry>1</entry> <entry> <link linkend="regexiterator.constants.use-key">RegexIterator::USE_KEY</link> </entry> </row> </tbody> </tgroup> </table> </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.void; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>RegexIterator::setFlags</function> example</title> <para> Creates a new RegexIterator that filters all entries with where the array key starts with 'test'. </para> <programlisting role="php"> <![CDATA[ <?php $test = array ('str1' => 'test 1', 'teststr2' => 'another test', 'str3' => 'test 123'); $arrayIterator = new ArrayIterator($test); $regexIterator = new RegexIterator($arrayIterator, '/^test/'); $regexIterator->setFlags(RegexIterator::USE_KEY); foreach ($regexIterator as $key => $value) { echo $key . ' => ' . $value . "\n"; } ?> ]]> </programlisting> &example.outputs.similar; <screen> <![CDATA[ teststr2 => another test ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>RegexIterator::getFlags</function></member> </simplelist> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/spl/regexiterator/setpregflags.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/spl/regexiterator/setpregflags.xml +++ phpdoc/en/reference/spl/regexiterator/setpregflags.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="regexiterator.setpregflags" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>RegexIterator::setPregFlags</refname> <refpurpose>Sets the regular expression flags.</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <!-- Example: All methods have this --> <type>void</type><methodname>RegexIterator::setPregFlags</methodname> <methodparam><type>int</type><parameter>preg_flags</parameter></methodparam> </methodsynopsis> <para> Sets the regular expression flags. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>preg_flags</parameter></term> <listitem> <para> The regular expression flags. See <methodname>RegexIterator::__construct</methodname> for an overview of available flags. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.void; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>RegexIterator::setPregFlags</function> example</title> <para> Creates a new RegexIterator that filters all entries with where the array key starts with 'test'. </para> <programlisting role="php"> <![CDATA[ <?php $test = array ('test 1', 'another test', 'test 123'); $arrayIterator = new ArrayIterator($test); $regexIterator = new RegexIterator($arrayIterator, '/^test/', RegexIterator::GET_MATCH); $regexIterator->setPregFlags(PREG_OFFSET_CAPTURE); foreach ($regexIterator as $key => $value) { var_dump($value); } ?> ]]> </programlisting> &example.outputs.similar; <screen> <![CDATA[ array(1) { [0]=> array(2) { [0]=> string(4) "test" [1]=> int(0) } } array(1) { [0]=> array(2) { [0]=> string(4) "test" [1]=> int(0) } } ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>RegexIterator::getPregFlags</function></member> </simplelist> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
« previous php.doc.cvs (#4329) next »