php-doc-en/reference/mbstring/functions/mb-regex-set-options.xml
Kalle Sommer Nielsen 2c6f22d619 Fixed bug #50316 (mb-regex options have to be documented)
# Modifier details taken from the Oniguruma API
# http://www.geocities.jp/kosako3/oniguruma/doc/API.txt

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@293213 c90b9560-bf6c-de11-be94-00142212c4b1
2010-01-07 12:15:14 +00:00

171 lines
4.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.mb-regex-set-options" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>mb_regex_set_options</refname>
<refpurpose>Set/Get the default options for mbregex functions</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>mb_regex_set_options</methodname>
<methodparam choice="opt"><type>string</type><parameter>options</parameter><initializer>"msr"</initializer></methodparam>
</methodsynopsis>
<simpara>
Sets the default options described by <parameter>options</parameter>
for multibyte regex functions.
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>options</parameter></term>
<listitem>
<para>
The options to set. This is a a string where each
character is an option. To set a mode, the mode
character must be the last one set, however there
can only be set one mode but multiple options.
</para>
<table>
<title>Regex options</title>
<tgroup cols="4">
<thead>
<row>
<entry>Option</entry>
<entry>Meaning</entry>
</row>
</thead>
<tbody>
<row>
<entry>i</entry>
<entry>Ambiguity match on</entry>
</row>
<row>
<entry>x</entry>
<entry>Enables extended pattern form</entry>
</row>
<row>
<entry>m</entry>
<entry><literal>'.'</literal> matches with newlines</entry>
</row>
<row>
<entry>s</entry>
<entry><literal>'^'</literal> -> <literal>'\A'</literal>, <literal>'$'</literal> -> <literal>'\Z'</literal></entry>
</row>
<row>
<entry>p</entry>
<entry>Same as both the <literal>m</literal> and <literal>s</literal> options</entry>
</row>
<row>
<entry>l</entry>
<entry>Finds longest matches</entry>
</row>
<row>
<entry>n</entry>
<entry>Ignores empty matches</entry>
</row>
<row>
<entry>e</entry>
<entry><function>eval</function> resulting code</entry>
</row>
</tbody>
</tgroup>
</table>
<table>
<title>Regex syntax modes</title>
<tgroup cols="4">
<thead>
<row>
<entry>Mode</entry>
<entry>Meaning</entry>
</row>
</thead>
<tbody>
<row>
<entry>j</entry>
<entry>Java (Sun java.util.regex)</entry>
</row>
<row>
<entry>u</entry>
<entry>GNU regex</entry>
</row>
<row>
<entry>g</entry>
<entry>grep</entry>
</row>
<row>
<entry>c</entry>
<entry>Emacs</entry>
</row>
<row>
<entry>r</entry>
<entry>Ruby</entry>
</row>
<row>
<entry>z</entry>
<entry>Perl</entry>
</row>
<row>
<entry>b</entry>
<entry>POSIX Basic regex</entry>
</row>
<row>
<entry>d</entry>
<entry>POSIX Extended regex</entry>
</row>
</tbody>
</tgroup>
</table>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The previous options. If <parameter>options</parameter> is omitted,
it returns the <type>string</type> that describes the current options.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>mb_split</function></member>
<member><function>mb_ereg</function></member>
<member><function>mb_eregi</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:"~/.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
-->