php-doc-en/reference/mongo/mongoregex.xml
2013-05-24 22:18:15 +00:00

131 lines
3.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<phpdoc:classref xml:id="class.mongoregex" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<title>The MongoRegex class</title>
<titleabbrev>MongoRegex</titleabbrev>
<partintro>
<!-- {{{ MongoRegex intro -->
<section xml:id="mongoregex.intro">
&reftitle.intro;
<para>
This class can be used to create regular expressions. Typically, these
expressions will be used to query the database and find matching strings.
More unusually, they can be saved to the database and retrieved.
</para>
<para>
Regular expressions consist of four parts. First a <literal>/</literal>
as starting delimiter, then then pattern, another <literal>/</literal>
and finally a string containing flags.
</para>
<para>
<example>
<title>Regular expression pattern</title>
<screen>
<![CDATA[
/pattern/flags
]]>
</screen>
</example>
</para>
<para>
MongoDB recognizes six regular expression flags:
</para>
<itemizedlist>
<listitem>
<para>
<literal>i</literal>: Case insensitive
</para>
</listitem>
<listitem>
<para>
<literal>m</literal>: Multiline
</para>
</listitem>
<listitem>
<para>
<literal>x</literal>: Can contain comments
</para>
</listitem>
<listitem>
<para>
<literal>l</literal>: locale
</para>
</listitem>
<listitem>
<para>
<literal>s</literal>: dotall, "." matches everything, including newlines
</para>
</listitem>
<listitem>
<para>
<literal>u</literal>: match unicode
</para>
</listitem>
</itemizedlist>
</section>
<!-- }}} -->
<section xml:id="mongoregex.synopsis">
&reftitle.classsynopsis;
<!-- {{{ Synopsis -->
<classsynopsis>
<ooclass><classname>MongoRegex</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<classname>MongoRegex</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">Fields</classsynopsisinfo>
<fieldsynopsis>
<modifier>public</modifier>
<type>string</type>
<varname>regex</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<type>string</type>
<varname>flags</varname>
</fieldsynopsis>
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.mongoregex')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
</classsynopsis>
<!-- }}} -->
</section>
</partintro>
&reference.mongo.entities.mongoregex;
</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:"~/.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
-->