svn: /phpdoc/ru/trunk/reference/pcre/functions/ preg-grep.xml

From: Date: Mon, 14 Mar 2011 18:08:33 +0000
Subject: svn: /phpdoc/ru/trunk/reference/pcre/functions/ preg-grep.xml
Groups: php.doc.ru 
Request: Send a blank email to doc-ru+get-1546@lists.php.net to get a copy of this message
shein Mon, 14 Mar 2011 18:08:33 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=309229 Log: Updated translation. Changed paths: U phpdoc/ru/trunk/reference/pcre/functions/preg-grep.xml Modified: phpdoc/ru/trunk/reference/pcre/functions/preg-grep.xml =================================================================== --- phpdoc/ru/trunk/reference/pcre/functions/preg-grep.xml 2011-03-14 16:02:04 UTC (rev 309228) +++ phpdoc/ru/trunk/reference/pcre/functions/preg-grep.xml 2011-03-14 18:08:33 UTC (rev 309229) @@ -1,57 +1,115 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- EN-Revision: 307739 Maintainer: shein Status: ready --> +<!-- Reviewed: no --> <!-- $Revision$ --> -<!-- EN-Revision: n/a Maintainer: young Status: ready --> -<!-- splitted from ./en/functions/pcre.xml, last change in rev 1.2 --> - <refentry xml:id="function.preg-grep" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>preg_grep</refname> - <refpurpose> - Возвращает массив вхождений, которые соответствуют шаблону - </refpurpose> - </refnamediv> - <refsect1> - <title>Описание</title> - <methodsynopsis> - <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> +<refentry xml:id="function.preg-grep" xmlns="http://docbook.org/ns/docbook"> + <refnamediv> + <refname>preg_grep</refname> + <refpurpose>Возвращает массив вхождений, которые соответствуют шаблону</refpurpose> + </refnamediv> - <para> - <function>preg_grep</function> возвращает массив, состоящий из элементов - входящего массива <parameter>input</parameter>, которые соответствуют заданному - шаблону <parameter>pattern</parameter>. - </para> - - <para> - Параметр <parameter>flags</parameter> может принимать следующие значения: - <variablelist> - <varlistentry> - <term>PREG_GREP_INVERT</term> - <listitem> - <simpara> - В случае, если этот флаг установлен, функция <function>preg_grep</function>, - возвращает те элементы массива, которые <emphasis>не соответствуют</emphasis> - заданному шаблону <parameter>pattern</parameter>. - Этот флаг доступен, начиная с <literal>PHP</literal> 4.2.0. - </simpara> - </listitem> - </varlistentry> - </variablelist> - </para> + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <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><initializer>0</initializer></methodparam> + </methodsynopsis> + <para> + Возвращает массив, состоящий из элементов входящего массива + <parameter>input</parameter>, которые соответствуют заданному + шаблону <parameter>pattern</parameter>. + </para> + </refsect1> - <para> - Начиная с PHP 4.0.4, результат, возвращаемый функцией <function>preg_grep</function> - использует те же индексы, что и массив исходных данных. Если такое поведение - вам не подходит, примените <function>array_values</function> к массиву, возвращаемому - <function>preg_grep</function> для реиндексации. - </para> + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>pattern</parameter></term> + <listitem> + <para> + Искомый шаблон, строка. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>input</parameter></term> + <listitem> + <para> + Входящий массив. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>flags</parameter></term> + <listitem> + <para> + В случае, если установлен в <constant>PREG_GREP_INVERT</constant>, + функция <function>preg_grep</function> возвращает те элементы + массива, которые <emphasis>не соответствуют</emphasis> + заданному шаблону <parameter>pattern</parameter>. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> - <para> - <example> - <title><function>preg_grep</function> пример</title> - <programlisting role="php"> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Возвращает массив, индексированный ключами из массива + <parameter>input</parameter>. + </para> + </refsect1> + + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>4.2.0</entry> + <entry> + Добавлен параметр <parameter>flags</parameter>. + </entry> + </row> + <row> + <entry>4.0.4</entry> + <entry> + <para> + До этой версии, возвращаемый массив индексировался ключами вне + зависимости от массива <parameter>input</parameter>. + </para> + <para> + Если вы хотите воспроизвести это поведение, используйте + функцию <function>array_values</function> на полученных + значениях для переиндексации. + </para> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Пример использования <function>preg_grep</function></title> + <programlisting role="php"> <![CDATA[ <?php // Возвращает все элементы массива, @@ -59,12 +117,26 @@ $fl_array = preg_grep("/^(\d+)?\.\d+$/", $array); ?> ]]> - </programlisting> - </example> - </para> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><link linkend="pcre.pattern">Регулярные выражения PCRE</link></member> + <member><function>preg_match_all</function></member> + <member><function>preg_filter</function></member> + <member><function>preg_last_error</function></member> + </simplelist> + </para> + </refsect1> + +</refentry> + <!-- Keep this comment at the end of the file Local variables: mode: sgml @@ -76,7 +148,7 @@ sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil -sgml-default-dtd-file:"../~/.phpdoc/manual.ced" +sgml-default-dtd-file:"~/.phpdoc/manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil @@ -85,4 +157,3 @@ vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> - \ No newline at end of file

« previous php.doc.ru (#1546) next »