mirror of
https://github.com/php/doc-ru.git
synced 2026-03-26 00:32:15 +01:00
101 lines
3.0 KiB
XML
101 lines
3.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<!-- EN-Revision: d51166ca16fda8e766849505b84f9306ef443f71 Maintainer: tmn Status: ready -->
|
||
<!-- Reviewed: no -->
|
||
<refentry xml:id="regexiterator.accept" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||
<refnamediv>
|
||
<refname>RegexIterator::accept</refname>
|
||
<refpurpose>Проверка соответствия регулярному выражению</refpurpose>
|
||
</refnamediv>
|
||
|
||
<refsect1 role="description">
|
||
&reftitle.description;
|
||
<methodsynopsis role="RegexIterator">
|
||
<modifier>public</modifier> <type>bool</type><methodname>RegexIterator::accept</methodname>
|
||
<void/>
|
||
</methodsynopsis>
|
||
<para>
|
||
Проверяет соответствие строки <literal>(string)</literal>, которую вернул
|
||
метод <methodname>RegexIterator::current</methodname>
|
||
(или <methodname>RegexIterator::key</methodname>, если установлен флаг
|
||
<link linkend="regexiterator.constants.use-key">RegexIterator::USE_KEY</link>),
|
||
регулярному выражению.
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="parameters">
|
||
&reftitle.parameters;
|
||
&no.function.parameters;
|
||
</refsect1>
|
||
|
||
<refsect1 role="returnvalues">
|
||
&reftitle.returnvalues;
|
||
<para>
|
||
&true;, если значение элемента соответствует регулярному выражению,
|
||
&false; в противном случае.
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="examples">
|
||
&reftitle.examples;
|
||
<para>
|
||
<example xml:id="regexiterator.accept.example.basic">
|
||
<title>Пример использования <methodname>RegexIterator::accept</methodname></title>
|
||
<para>
|
||
В этом примере будет осуществляться навигация только по тем элементам, значения
|
||
которых соответствуют регулярному выражению.
|
||
</para>
|
||
<programlisting role="php">
|
||
<![CDATA[
|
||
<?php
|
||
$names = new ArrayIterator(array('Ann', 'Bob', 'Charlie', 'David'));
|
||
$filter = new RegexIterator($names, '/^[B-D]/');
|
||
foreach ($filter as $name) {
|
||
echo $name . PHP_EOL;
|
||
}
|
||
?>
|
||
]]>
|
||
</programlisting>
|
||
&example.outputs;
|
||
<screen>
|
||
<![CDATA[
|
||
Bob
|
||
Charlie
|
||
David
|
||
]]>
|
||
</screen>
|
||
</example>
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="seealso">
|
||
&reftitle.seealso;
|
||
<para>
|
||
<simplelist>
|
||
<member><link linkend="regexiterator.constants">Константы RegexIterator</link></member>
|
||
<member><methodname>RegexIterator::setFlags</methodname></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:"~/.phpdoc/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
|
||
-->
|