[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-doc-cvs
Subject:    Re: [DOC-CVS] svn: /phpdoc/en/trunk/reference/pcre/ pattern.syntax.xml
From:       Peter Cowburn <petercowburn () gmail ! com>
Date:       2014-07-29 13:21:56
Message-ID: CAPg3XxJ=CO-Uv0rBy=+S-bczdYCnDC8u3hUzEX=E+oXCi6PrfA () mail ! gmail ! com
[Download RAW message or body]


On 29 July 2014 13:46, Chris Wright <daverandom@php.net> wrote:

> daverandom                               Tue, 29 Jul 2014 12:46:16 +0000
>
> Revision: http://svn.php.net/viewvc?view=revision&revision=334410


This revision nukes my changes made earlier today with regard to better
positioning that paragraph about the bracket delimiters. *sad face*


>
>
> Log:
> Clarify some details of using bracket-style delimiters in regular
> expression patterns
>
> Patch suggested by Brandon Kelly (brandon@pixelandtonic.com)
>
> Changed paths:
>     U   phpdoc/en/trunk/reference/pcre/pattern.syntax.xml
>
> Modified: phpdoc/en/trunk/reference/pcre/pattern.syntax.xml
> ===================================================================
> --- phpdoc/en/trunk/reference/pcre/pattern.syntax.xml   2014-07-29
> 11:22:38 UTC (rev 334409)
> +++ phpdoc/en/trunk/reference/pcre/pattern.syntax.xml   2014-07-29
> 12:46:16 UTC (rev 334410)
> @@ -44,25 +44,12 @@
>  #^[^0-9]$#
>  +php+
>  %[a-zA-Z0-9_-]%
> +{\w[\w0-9]*}
>  ]]>
>      </programlisting>
>     </informalexample>
>    </para>
>    <para>
> -   In addition to the aforementioned delimiters, it is also possible to
> use
> -   bracket style delimiters where the opening and closing brackets are the
> -   starting and ending delimiter, respectively.
> -   <informalexample>
> -    <programlisting>
> -<![CDATA[
> -{this is a pattern}
> -(foobar)
> -<\d+>
> -]]>
> -    </programlisting>
> -   </informalexample>
> -  </para>
> -  <para>
>     If the delimiter needs to be matched inside the pattern it must be
>     escaped using a backslash. If the delimiter appears often inside the
>     pattern, it is a good idea to choose another delimiter in order to
> increase
> @@ -80,6 +67,26 @@
>     to specify the delimiter to be escaped.
>    </para>
>    <para>
> +   In addition to the aforementioned delimiters, it is also possible to
> use
> +   bracket style delimiters where the opening and closing brackets are the
> +   starting and ending delimiter, respectively. <literal>()</literal>,
> +   <literal>{}</literal>, <literal>[]</literal> and
> <literal>&lt;&gt;</literal>
> +   are all valid bracket style delimiter pairs.
> +   <informalexample>
> +    <programlisting>
> +<![CDATA[
> +(this [is] a (pattern))
> +{this [is] a (pattern)}
> +[this [is] a (pattern)]
> +<this [is] a (pattern)>
> +]]>
> +    </programlisting>
> +   </informalexample>
> +   Bracket style delimiters do not need to be escaped when they are used
> as meta
> +   characters within the pattern, but as with other delimiters they must
> be
> +   escaped when they are used as literal characters.
> +  </para>
> +  <para>
>     You may add <link linkend="reference.pcre.pattern.modifiers">pattern
>     modifiers</link> after the ending delimiter. The following is an
> example
>     of case-insensitive matching:
>
>
> --
> PHP Documentation Commits Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic