added license info in copyright notice at the footer

[SVN r40867]
This commit is contained in:
Joel de Guzman
2007-11-07 03:23:31 +00:00
parent 39eb48c805
commit 15f764a95a
82 changed files with 3013 additions and 2625 deletions

View File

@ -1,13 +1,16 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>POSIX Extended Regular Expression Syntax</title>
<title> POSIX Extended Regular
Expression Syntax</title>
<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
<link rel="start" href="../../index.html" title="Boost.Regex">
<link rel="up" href="../syntax.html" title="Regular Expression Syntax">
<link rel="prev" href="perl_syntax.html" title="Perl Regular Expression Syntax">
<link rel="next" href="basic_syntax.html" title="POSIX Basic Regular Expression Syntax">
<link rel="up" href="../syntax.html" title=" Regular Expression Syntax">
<link rel="prev" href="perl_syntax.html" title=" Perl Regular Expression
Syntax">
<link rel="next" href="basic_syntax.html" title=" POSIX Basic Regular
Expression Syntax">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@ -24,18 +27,18 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.syntax.basic_extended"></a><a href="basic_extended.html" title="POSIX Extended Regular Expression Syntax"> POSIX Extended Regular
Expression Syntax</a>
</h3></div></div></div>
<a name="boost_regex.syntax.basic_extended.synopsis"></a><h4>
<a name="id504125"></a>
<a name="boost_regex.syntax.basic_extended"></a><a href="basic_extended.html" title=" POSIX Extended Regular
Expression Syntax"> POSIX Extended Regular
Expression Syntax</a></h3></div></div></div>
<a name="boost_regex.syntax.basic_extended.synopsis"></a><h3>
<a name="id470414"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.synopsis">Synopsis</a>
</h4>
</h3>
<p>
The POSIX-Extended regular expression syntax is supported by the POSIX C
regular expression API's, and variations are used by the utilities <code class="computeroutput"><span class="identifier">egrep</span></code> and <code class="computeroutput"><span class="identifier">awk</span></code>.
regular expression API's, and variations are used by the utilities <tt class="computeroutput"><span class="identifier">egrep</span></tt> and <tt class="computeroutput"><span class="identifier">awk</span></tt>.
You can construct POSIX extended regular expressions in Boost.Regex by passing
the flag <code class="computeroutput"><span class="identifier">extended</span></code> to the
the flag <tt class="computeroutput"><span class="identifier">extended</span></tt> to the
regex constructor, for example:
</p>
<pre class="programlisting">
@ -46,38 +49,38 @@
</pre>
<a name="boost_regex.posix_extended_syntax"></a><p>
</p>
<a name="boost_regex.syntax.basic_extended.posix_extended_syntax"></a><h4>
<a name="id504391"></a>
<a name="boost_regex.syntax.basic_extended.posix_extended_syntax"></a><h3>
<a name="id470682"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.posix_extended_syntax">POSIX
Extended Syntax</a>
</h4>
</h3>
<p>
In POSIX-Extended regular expressions, all characters match themselves except
for the following special characters:
</p>
<pre class="programlisting">.[{()\*+?|^$</pre>
<a name="boost_regex.syntax.basic_extended.wildcard_"></a><h5>
<a name="id504431"></a>
<a name="boost_regex.syntax.basic_extended.wildcard_"></a><h4>
<a name="id470723"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.wildcard_">Wildcard:</a>
</h5>
</h4>
<p>
The single character '.' when used outside of a character set will match
any single character except:
</p>
<div class="itemizedlist"><ul type="disc">
<li>
The NULL character when the flag <code class="computeroutput"><span class="identifier">match_no_dot_null</span></code>
The NULL character when the flag <tt class="computeroutput"><span class="identifier">match_no_dot_null</span></tt>
is passed to the matching algorithms.
</li>
<li>
The newline character when the flag <code class="computeroutput"><span class="identifier">match_not_dot_newline</span></code>
The newline character when the flag <tt class="computeroutput"><span class="identifier">match_not_dot_newline</span></tt>
is passed to the matching algorithms.
</li>
</ul></div>
<a name="boost_regex.syntax.basic_extended.anchors_"></a><h5>
<a name="id504499"></a>
<a name="boost_regex.syntax.basic_extended.anchors_"></a><h4>
<a name="id470793"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.anchors_">Anchors:</a>
</h5>
</h4>
<p>
A '^' character shall match the start of a line when used as the first character
of an expression, or the first character of a sub-expression.
@ -86,39 +89,39 @@
A '$' character shall match the end of a line when used as the last character
of an expression, or the last character of a sub-expression.
</p>
<a name="boost_regex.syntax.basic_extended.marked_sub_expressions_"></a><h5>
<a name="id504534"></a>
<a name="boost_regex.syntax.basic_extended.marked_sub_expressions_"></a><h4>
<a name="id470830"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.marked_sub_expressions_">Marked
sub-expressions:</a>
</h5>
</h4>
<p>
A section beginning <code class="computeroutput"><span class="special">(</span></code> and ending
<code class="computeroutput"><span class="special">)</span></code> acts as a marked sub-expression.
A section beginning <tt class="computeroutput"><span class="special">(</span></tt> and ending
<tt class="computeroutput"><span class="special">)</span></tt> acts as a marked sub-expression.
Whatever matched the sub-expression is split out in a separate field by the
matching algorithms. Marked sub-expressions can also repeated, or referred
to by a back-reference.
</p>
<a name="boost_regex.syntax.basic_extended.repeats_"></a><h5>
<a name="id504591"></a>
<a name="boost_regex.syntax.basic_extended.repeats_"></a><h4>
<a name="id470888"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.repeats_">Repeats:</a>
</h5>
</h4>
<p>
Any atom (a single character, a marked sub-expression, or a character class)
can be repeated with the <code class="computeroutput"><span class="special">*</span></code>,
<code class="computeroutput"><span class="special">+</span></code>, <code class="computeroutput"><span class="special">?</span></code>,
and <code class="computeroutput"><span class="special">{}</span></code> operators.
can be repeated with the <tt class="computeroutput"><span class="special">*</span></tt>,
<tt class="computeroutput"><span class="special">+</span></tt>, <tt class="computeroutput"><span class="special">?</span></tt>,
and <tt class="computeroutput"><span class="special">{}</span></tt> operators.
</p>
<p>
The <code class="computeroutput"><span class="special">*</span></code> operator will match the
The <tt class="computeroutput"><span class="special">*</span></tt> operator will match the
preceding atom <span class="emphasis"><em>zero or more times</em></span>, for example the expression
<code class="computeroutput"><span class="identifier">a</span><span class="special">*</span><span class="identifier">b</span></code> will match any of the following:
<tt class="computeroutput"><span class="identifier">a</span><span class="special">*</span><span class="identifier">b</span></tt> will match any of the following:
</p>
<pre class="programlisting">b
ab
aaaaaaaab
</pre>
<p>
The <code class="computeroutput"><span class="special">+</span></code> operator will match the
The <tt class="computeroutput"><span class="special">+</span></tt> operator will match the
preceding atom <span class="emphasis"><em>one or more times</em></span>, for example the expression
a+b will match any of the following:
</p>
@ -131,9 +134,9 @@ aaaaaaaab
<pre class="programlisting">b
</pre>
<p>
The <code class="computeroutput"><span class="special">?</span></code> operator will match the
The <tt class="computeroutput"><span class="special">?</span></tt> operator will match the
preceding atom <span class="emphasis"><em>zero or one times</em></span>, for example the expression
<code class="computeroutput"><span class="identifier">ca</span><span class="special">?</span><span class="identifier">b</span></code> will match any of the following:
<tt class="computeroutput"><span class="identifier">ca</span><span class="special">?</span><span class="identifier">b</span></tt> will match any of the following:
</p>
<pre class="programlisting">cb
cab
@ -147,15 +150,15 @@ cab
An atom can also be repeated with a bounded repeat:
</p>
<p>
<code class="computeroutput"><span class="identifier">a</span><span class="special">{</span><span class="identifier">n</span><span class="special">}</span></code> Matches
<tt class="computeroutput"><span class="identifier">a</span><span class="special">{</span><span class="identifier">n</span><span class="special">}</span></tt> Matches
'a' repeated <span class="emphasis"><em>exactly n times</em></span>.
</p>
<p>
<code class="computeroutput"><span class="identifier">a</span><span class="special">{</span><span class="identifier">n</span><span class="special">,}</span></code> Matches
<tt class="computeroutput"><span class="identifier">a</span><span class="special">{</span><span class="identifier">n</span><span class="special">,}</span></tt> Matches
'a' repeated <span class="emphasis"><em>n or more times</em></span>.
</p>
<p>
<code class="computeroutput"><span class="identifier">a</span><span class="special">{</span><span class="identifier">n</span><span class="special">,</span> <span class="identifier">m</span><span class="special">}</span></code> Matches 'a' repeated <span class="emphasis"><em>between n
<tt class="computeroutput"><span class="identifier">a</span><span class="special">{</span><span class="identifier">n</span><span class="special">,</span> <span class="identifier">m</span><span class="special">}</span></tt> Matches 'a' repeated <span class="emphasis"><em>between n
and m times inclusive</em></span>.
</p>
<p>
@ -184,13 +187,13 @@ cab
<span class="identifier">a</span><span class="special">(*)</span>
</pre>
<p>
Will raise an error, as there is nothing for the <code class="computeroutput"><span class="special">*</span></code>
Will raise an error, as there is nothing for the <tt class="computeroutput"><span class="special">*</span></tt>
operator to be applied to.
</p>
<a name="boost_regex.syntax.basic_extended.back_references_"></a><h5>
<a name="id505042"></a>
<a name="boost_regex.syntax.basic_extended.back_references_"></a><h4>
<a name="id471342"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.back_references_">Back references:</a>
</h5>
</h4>
<p>
An escape character followed by a digit <span class="emphasis"><em>n</em></span>, where <span class="emphasis"><em>n</em></span>
is in the range 1-9, matches the same string that was matched by sub-expression
@ -214,29 +217,29 @@ cab
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="../../../../../../doc/html/images/caution.png"></td>
<th align="left">Caution</th>
</tr>
<tr><td align="left" valign="top"><p>
<tr><td colspan="2" align="left" valign="top"><p>
The POSIX standard does not support back-references for "extended"
regular expressions, this is a compatible extension to that standard.
</p></td></tr>
</table></div>
<a name="boost_regex.syntax.basic_extended.alternation"></a><h5>
<a name="id505138"></a>
<a name="boost_regex.syntax.basic_extended.alternation"></a><h4>
<a name="id471440"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.alternation">Alternation</a>
</h5>
</h4>
<p>
The <code class="computeroutput"><span class="special">|</span></code> operator will match either
of its arguments, so for example: <code class="computeroutput"><span class="identifier">abc</span><span class="special">|</span><span class="identifier">def</span></code> will
The <tt class="computeroutput"><span class="special">|</span></tt> operator will match either
of its arguments, so for example: <tt class="computeroutput"><span class="identifier">abc</span><span class="special">|</span><span class="identifier">def</span></tt> will
match either "abc" or "def".
</p>
<p>
Parenthesis can be used to group alternations, for example: <code class="computeroutput"><span class="identifier">ab</span><span class="special">(</span><span class="identifier">d</span><span class="special">|</span><span class="identifier">ef</span><span class="special">)</span></code>
Parenthesis can be used to group alternations, for example: <tt class="computeroutput"><span class="identifier">ab</span><span class="special">(</span><span class="identifier">d</span><span class="special">|</span><span class="identifier">ef</span><span class="special">)</span></tt>
will match either of "abd" or "abef".
</p>
<a name="boost_regex.syntax.basic_extended.character_sets_"></a><h5>
<a name="id505242"></a>
<a name="boost_regex.syntax.basic_extended.character_sets_"></a><h4>
<a name="id471545"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.character_sets_">Character
sets:</a>
</h5>
</h4>
<p>
A character set is a bracket-expression starting with [ and ending with ],
it defines a set of characters, and matches any single character that is
@ -245,72 +248,73 @@ cab
<p>
A bracket expression may contain any combination of the following:
</p>
<a name="boost_regex.syntax.basic_extended.single_characters_"></a><h6>
<a name="id505278"></a>
<a name="boost_regex.syntax.basic_extended.single_characters_"></a><h5>
<a name="id471583"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.single_characters_">Single
characters:</a>
</h6>
</h5>
<p>
For example <code class="computeroutput"><span class="special">[</span><span class="identifier">abc</span><span class="special">]</span></code>, will match any of the characters 'a', 'b',
For example <tt class="computeroutput"><span class="special">[</span><span class="identifier">abc</span><span class="special">]</span></tt>, will match any of the characters 'a', 'b',
or 'c'.
</p>
<a name="boost_regex.syntax.basic_extended.character_ranges_"></a><h6>
<a name="id505328"></a>
<a name="boost_regex.syntax.basic_extended.character_ranges_"></a><h5>
<a name="id471636"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.character_ranges_">Character
ranges:</a>
</h6>
</h5>
<p>
For example <code class="computeroutput"><span class="special">[</span><span class="identifier">a</span><span class="special">-</span><span class="identifier">c</span><span class="special">]</span></code>
For example <tt class="computeroutput"><span class="special">[</span><span class="identifier">a</span><span class="special">-</span><span class="identifier">c</span><span class="special">]</span></tt>
will match any single character in the range 'a' to 'c'. By default, for
POSIX-Extended regular expressions, a character <span class="emphasis"><em>x</em></span> is
within the range <span class="emphasis"><em>y</em></span> to <span class="emphasis"><em>z</em></span>, if it
collates within that range; this results in locale specific behavior . This
behavior can be turned off by unsetting the <code class="computeroutput"><span class="identifier">collate</span></code>
<a href="../ref/syntax_option_type.html" title="syntax_option_type">option flag</a> - in
behavior can be turned off by unsetting the <tt class="computeroutput"><span class="identifier">collate</span></tt>
<a href="../ref/syntax_option_type.html" title=" syntax_option_type">option flag</a> - in
which case whether a character appears within a range is determined by comparing
the code points of the characters only.
</p>
<a name="boost_regex.syntax.basic_extended.negation_"></a><h6>
<a name="id505429"></a>
<a name="boost_regex.syntax.basic_extended.negation_"></a><h5>
<a name="id471737"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.negation_">Negation:</a>
</h6>
</h5>
<p>
If the bracket-expression begins with the ^ character, then it matches the
complement of the characters it contains, for example <code class="computeroutput"><span class="special">[^</span><span class="identifier">a</span><span class="special">-</span><span class="identifier">c</span><span class="special">]</span></code> matches any character that is not in the
range <code class="computeroutput"><span class="identifier">a</span><span class="special">-</span><span class="identifier">c</span></code>.
complement of the characters it contains, for example <tt class="computeroutput"><span class="special">[^</span><span class="identifier">a</span><span class="special">-</span><span class="identifier">c</span><span class="special">]</span></tt> matches any character that is not in the
range <tt class="computeroutput"><span class="identifier">a</span><span class="special">-</span><span class="identifier">c</span></tt>.
</p>
<a name="boost_regex.syntax.basic_extended.character_classes_"></a><h6>
<a name="id505512"></a>
<a name="boost_regex.syntax.basic_extended.character_classes_"></a><h5>
<a name="id471821"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.character_classes_">Character
classes:</a>
</h6>
</h5>
<p>
An expression of the form <code class="computeroutput"><span class="special">[[:</span><span class="identifier">name</span><span class="special">:]]</span></code>
matches the named character class "name", for example <code class="computeroutput"><span class="special">[[:</span><span class="identifier">lower</span><span class="special">:]]</span></code> matches any lower case character. See
<a href="character_classes.html" title="Character Class Names">character class names</a>.
An expression of the form <tt class="computeroutput"><span class="special">[[:</span><span class="identifier">name</span><span class="special">:]]</span></tt>
matches the named character class "name", for example <tt class="computeroutput"><span class="special">[[:</span><span class="identifier">lower</span><span class="special">:]]</span></tt> matches any lower case character. See
<a href="character_classes.html" title=" Character Class
Names">character class names</a>.
</p>
<a name="boost_regex.syntax.basic_extended.collating_elements_"></a><h6>
<a name="id505594"></a>
<a name="boost_regex.syntax.basic_extended.collating_elements_"></a><h5>
<a name="id471905"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.collating_elements_">Collating
Elements:</a>
</h6>
</h5>
<p>
An expression of the form <code class="computeroutput"><span class="special">[[.</span><span class="identifier">col</span><span class="special">.]</span></code> matches
An expression of the form <tt class="computeroutput"><span class="special">[[.</span><span class="identifier">col</span><span class="special">.]</span></tt> matches
the collating element <span class="emphasis"><em>col</em></span>. A collating element is any
single character, or any sequence of characters that collates as a single
unit. Collating elements may also be used as the end point of a range, for
example: <code class="computeroutput"><span class="special">[[.</span><span class="identifier">ae</span><span class="special">.]-</span><span class="identifier">c</span><span class="special">]</span></code>
example: <tt class="computeroutput"><span class="special">[[.</span><span class="identifier">ae</span><span class="special">.]-</span><span class="identifier">c</span><span class="special">]</span></tt>
matches the character sequence "ae", plus any single character
in the range "ae"-c, assuming that "ae" is treated as
a single collating element in the current locale.
</p>
<p>
Collating elements may be used in place of escapes (which are not normally
allowed inside character sets), for example <code class="computeroutput"><span class="special">[[.^.]</span><span class="identifier">abc</span><span class="special">]</span></code> would
allowed inside character sets), for example <tt class="computeroutput"><span class="special">[[.^.]</span><span class="identifier">abc</span><span class="special">]</span></tt> would
match either one of the characters 'abc^'.
</p>
<p>
As an extension, a collating element may also be specified via its <a href="collating_names.html" title="Collating Names">symbolic name</a>, for example:
As an extension, a collating element may also be specified via its <a href="collating_names.html" title=" Collating Names">symbolic name</a>, for example:
</p>
<pre class="programlisting">
<span class="special">[[.</span><span class="identifier">NUL</span><span class="special">.]]</span>
@ -318,35 +322,35 @@ cab
<p>
matches a NUL character.
</p>
<a name="boost_regex.syntax.basic_extended.equivalence_classes_"></a><h6>
<a name="id505757"></a>
<a name="boost_regex.syntax.basic_extended.equivalence_classes_"></a><h5>
<a name="id472066"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.equivalence_classes_">Equivalence
classes:</a>
</h6>
</h5>
<p>
An expression of the form <code class="computeroutput"><span class="special">[[=</span><span class="identifier">col</span><span class="special">=]]</span></code>,
An expression of the form <tt class="computeroutput"><span class="special">[[=</span><span class="identifier">col</span><span class="special">=]]</span></tt>,
matches any character or collating element whose primary sort key is the
same as that for collating element <span class="emphasis"><em>col</em></span>, as with colating
elements the name <span class="emphasis"><em>col</em></span> may be a <a href="collating_names.html" title="Collating Names">symbolic
elements the name <span class="emphasis"><em>col</em></span> may be a <a href="collating_names.html" title=" Collating Names">symbolic
name</a>. A primary sort key is one that ignores case, accentation, or
locale-specific tailorings; so for example <code class="computeroutput"><span class="special">[[=</span><span class="identifier">a</span><span class="special">=]]</span></code> matches
locale-specific tailorings; so for example <tt class="computeroutput"><span class="special">[[=</span><span class="identifier">a</span><span class="special">=]]</span></tt> matches
any of the characters: a, <20>, <20>, <20>, <20>, <20>, <20>, A, <20>, <20>, <20>, <20>, <20> and <20>. Unfortunately implementation
of this is reliant on the platform's collation and localisation support;
this feature can not be relied upon to work portably across all platforms,
or even all locales on one platform.
</p>
<a name="boost_regex.syntax.basic_extended.combinations_"></a><h6>
<a name="id505861"></a>
<a name="boost_regex.syntax.basic_extended.combinations_"></a><h5>
<a name="id472176"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.combinations_">Combinations:</a>
</h6>
</h5>
<p>
All of the above can be combined in one character set declaration, for example:
<code class="computeroutput"><span class="special">[[:</span><span class="identifier">digit</span><span class="special">:]</span><span class="identifier">a</span><span class="special">-</span><span class="identifier">c</span><span class="special">[.</span><span class="identifier">NUL</span><span class="special">.]]</span></code>.
<tt class="computeroutput"><span class="special">[[:</span><span class="identifier">digit</span><span class="special">:]</span><span class="identifier">a</span><span class="special">-</span><span class="identifier">c</span><span class="special">[.</span><span class="identifier">NUL</span><span class="special">.]]</span></tt>.
</p>
<a name="boost_regex.syntax.basic_extended.escapes"></a><h5>
<a name="id505941"></a>
<a name="boost_regex.syntax.basic_extended.escapes"></a><h4>
<a name="id472256"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.escapes">Escapes</a>
</h5>
</h4>
<p>
The POSIX standard defines no escape sequences for POSIX-Extended regular
expressions, except that:
@ -361,7 +365,7 @@ cab
<li>
An escape inside a character class declaration shall match itself: in other
words the escape character is not "special" inside a character
class declaration; so <code class="computeroutput"><span class="special">[\^]</span></code>
class declaration; so <tt class="computeroutput"><span class="special">[\^]</span></tt>
will match either a literal '\' or a '^'.
</li>
</ul></div>
@ -369,11 +373,11 @@ cab
However, that's rather restrictive, so the following standard-compatible
extensions are also supported by Boost.Regex:
</p>
<a name="boost_regex.syntax.basic_extended.escapes_matching_a_specific_character"></a><h6>
<a name="id506011"></a>
<a name="boost_regex.syntax.basic_extended.escapes_matching_a_specific_character"></a><h5>
<a name="id472326"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.escapes_matching_a_specific_character">Escapes
matching a specific character</a>
</h6>
</h5>
<p>
The following escape sequences are all synonyms for single characters:
</p>
@ -552,17 +556,17 @@ cab
<td>
<p>
Matches the single character which has the symbolic name name. For
example <code class="computeroutput"><span class="special">\\</span><span class="identifier">N</span><span class="special">{</span><span class="identifier">newline</span><span class="special">}</span></code> matches the single character \n.
example <tt class="computeroutput"><span class="special">\\</span><span class="identifier">N</span><span class="special">{</span><span class="identifier">newline</span><span class="special">}</span></tt> matches the single character \n.
</p>
</td>
</tr>
</tbody>
</table></div>
<a name="boost_regex.syntax.basic_extended._quot_single_character_quot__character_classes_"></a><h6>
<a name="id506358"></a>
<a name="boost_regex.syntax.basic_extended._quot_single_character_quot__character_classes_"></a><h5>
<a name="id472676"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended._quot_single_character_quot__character_classes_">"Single
character" character classes:</a>
</h6>
</h5>
<p>
Any escaped character <span class="emphasis"><em>x</em></span>, if <span class="emphasis"><em>x</em></span> is
the name of a character class shall match any character that is a member
@ -593,130 +597,130 @@ cab
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\</span><span class="identifier">d</span></code>
<tt class="computeroutput"><span class="special">\</span><span class="identifier">d</span></tt>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="special">[[:</span><span class="identifier">digit</span><span class="special">:]]</span></code>
<tt class="computeroutput"><span class="special">[[:</span><span class="identifier">digit</span><span class="special">:]]</span></tt>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\</span><span class="identifier">l</span></code>
<tt class="computeroutput"><span class="special">\</span><span class="identifier">l</span></tt>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="special">[[:</span><span class="identifier">lower</span><span class="special">:]]</span></code>
<tt class="computeroutput"><span class="special">[[:</span><span class="identifier">lower</span><span class="special">:]]</span></tt>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\</span><span class="identifier">s</span></code>
<tt class="computeroutput"><span class="special">\</span><span class="identifier">s</span></tt>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="special">[[:</span><span class="identifier">space</span><span class="special">:]]</span></code>
<tt class="computeroutput"><span class="special">[[:</span><span class="identifier">space</span><span class="special">:]]</span></tt>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\</span><span class="identifier">u</span></code>
<tt class="computeroutput"><span class="special">\</span><span class="identifier">u</span></tt>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="special">[[:</span><span class="identifier">upper</span><span class="special">:]]</span></code>
<tt class="computeroutput"><span class="special">[[:</span><span class="identifier">upper</span><span class="special">:]]</span></tt>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\</span><span class="identifier">w</span></code>
<tt class="computeroutput"><span class="special">\</span><span class="identifier">w</span></tt>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="special">[[:</span><span class="identifier">word</span><span class="special">:]]</span></code>
<tt class="computeroutput"><span class="special">[[:</span><span class="identifier">word</span><span class="special">:]]</span></tt>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\</span><span class="identifier">D</span></code>
<tt class="computeroutput"><span class="special">\</span><span class="identifier">D</span></tt>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="special">[^[:</span><span class="identifier">digit</span><span class="special">:]]</span></code>
<tt class="computeroutput"><span class="special">[^[:</span><span class="identifier">digit</span><span class="special">:]]</span></tt>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\</span><span class="identifier">L</span></code>
<tt class="computeroutput"><span class="special">\</span><span class="identifier">L</span></tt>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="special">[^[:</span><span class="identifier">lower</span><span class="special">:]]</span></code>
<tt class="computeroutput"><span class="special">[^[:</span><span class="identifier">lower</span><span class="special">:]]</span></tt>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\</span><span class="identifier">S</span></code>
<tt class="computeroutput"><span class="special">\</span><span class="identifier">S</span></tt>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="special">[^[:</span><span class="identifier">space</span><span class="special">:]]</span></code>
<tt class="computeroutput"><span class="special">[^[:</span><span class="identifier">space</span><span class="special">:]]</span></tt>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\</span><span class="identifier">U</span></code>
<tt class="computeroutput"><span class="special">\</span><span class="identifier">U</span></tt>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="special">[^[:</span><span class="identifier">upper</span><span class="special">:]]</span></code>
<tt class="computeroutput"><span class="special">[^[:</span><span class="identifier">upper</span><span class="special">:]]</span></tt>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\</span><span class="identifier">W</span></code>
<tt class="computeroutput"><span class="special">\</span><span class="identifier">W</span></tt>
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="special">[^[:</span><span class="identifier">word</span><span class="special">:]]</span></code>
<tt class="computeroutput"><span class="special">[^[:</span><span class="identifier">word</span><span class="special">:]]</span></tt>
</p>
</td>
</tr>
</tbody>
</table></div>
<a name="boost_regex.syntax.basic_extended.character_properties"></a><h6>
<a name="id506990"></a>
<a name="boost_regex.syntax.basic_extended.character_properties"></a><h5>
<a name="id473310"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.character_properties">Character
Properties</a>
</h6>
</h5>
<p>
The character property names in the following table are all equivalent to
the names used in character classes.
@ -748,7 +752,7 @@ cab
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\</span><span class="identifier">pX</span></code>
<tt class="computeroutput"><span class="special">\</span><span class="identifier">pX</span></tt>
</p>
</td>
<td>
@ -758,14 +762,14 @@ cab
</td>
<td>
<p>
<code class="computeroutput"><span class="special">[[:</span><span class="identifier">X</span><span class="special">:]]</span></code>
<tt class="computeroutput"><span class="special">[[:</span><span class="identifier">X</span><span class="special">:]]</span></tt>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\</span><span class="identifier">p</span><span class="special">{</span><span class="identifier">Name</span><span class="special">}</span></code>
<tt class="computeroutput"><span class="special">\</span><span class="identifier">p</span><span class="special">{</span><span class="identifier">Name</span><span class="special">}</span></tt>
</p>
</td>
<td>
@ -775,14 +779,14 @@ cab
</td>
<td>
<p>
<code class="computeroutput"><span class="special">[[:</span><span class="identifier">Name</span><span class="special">:]]</span></code>
<tt class="computeroutput"><span class="special">[[:</span><span class="identifier">Name</span><span class="special">:]]</span></tt>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\</span><span class="identifier">PX</span></code>
<tt class="computeroutput"><span class="special">\</span><span class="identifier">PX</span></tt>
</p>
</td>
<td>
@ -792,14 +796,14 @@ cab
</td>
<td>
<p>
<code class="computeroutput"><span class="special">[^[:</span><span class="identifier">X</span><span class="special">:]]</span></code>
<tt class="computeroutput"><span class="special">[^[:</span><span class="identifier">X</span><span class="special">:]]</span></tt>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\</span><span class="identifier">P</span><span class="special">{</span><span class="identifier">Name</span><span class="special">}</span></code>
<tt class="computeroutput"><span class="special">\</span><span class="identifier">P</span><span class="special">{</span><span class="identifier">Name</span><span class="special">}</span></tt>
</p>
</td>
<td>
@ -809,20 +813,20 @@ cab
</td>
<td>
<p>
<code class="computeroutput"><span class="special">[^[:</span><span class="identifier">Name</span><span class="special">:]]</span></code>
<tt class="computeroutput"><span class="special">[^[:</span><span class="identifier">Name</span><span class="special">:]]</span></tt>
</p>
</td>
</tr>
</tbody>
</table></div>
<p>
For example <code class="computeroutput"><span class="special">\</span><span class="identifier">pd</span></code>
matches any "digit" character, as does <code class="computeroutput"><span class="special">\</span><span class="identifier">p</span><span class="special">{</span><span class="identifier">digit</span><span class="special">}</span></code>.
For example <tt class="computeroutput"><span class="special">\</span><span class="identifier">pd</span></tt>
matches any "digit" character, as does <tt class="computeroutput"><span class="special">\</span><span class="identifier">p</span><span class="special">{</span><span class="identifier">digit</span><span class="special">}</span></tt>.
</p>
<a name="boost_regex.syntax.basic_extended.word_boundaries"></a><h6>
<a name="id507391"></a>
<a name="boost_regex.syntax.basic_extended.word_boundaries"></a><h5>
<a name="id473712"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.word_boundaries">Word Boundaries</a>
</h6>
</h5>
<p>
The following escape sequences match the boundaries of words:
</p>
@ -847,7 +851,7 @@ cab
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\&lt;</span></code>
<tt class="computeroutput"><span class="special">\&lt;</span></tt>
</p>
</td>
<td>
@ -859,7 +863,7 @@ cab
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\&gt;</span></code>
<tt class="computeroutput"><span class="special">\&gt;</span></tt>
</p>
</td>
<td>
@ -871,7 +875,7 @@ cab
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\</span><span class="identifier">b</span></code>
<tt class="computeroutput"><span class="special">\</span><span class="identifier">b</span></tt>
</p>
</td>
<td>
@ -883,7 +887,7 @@ cab
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\</span><span class="identifier">B</span></code>
<tt class="computeroutput"><span class="special">\</span><span class="identifier">B</span></tt>
</p>
</td>
<td>
@ -894,11 +898,11 @@ cab
</tr>
</tbody>
</table></div>
<a name="boost_regex.syntax.basic_extended.buffer_boundaries"></a><h6>
<a name="id507584"></a>
<a name="boost_regex.syntax.basic_extended.buffer_boundaries"></a><h5>
<a name="id473908"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.buffer_boundaries">Buffer
boundaries</a>
</h6>
</h5>
<p>
The following match only at buffer boundaries: a "buffer" in this
context is the whole of the input text that is being matched against (note
@ -949,7 +953,7 @@ cab
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\</span><span class="identifier">A</span></code>
<tt class="computeroutput"><span class="special">\</span><span class="identifier">A</span></tt>
</p>
</td>
<td>
@ -961,7 +965,7 @@ cab
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\</span><span class="identifier">z</span></code>
<tt class="computeroutput"><span class="special">\</span><span class="identifier">z</span></tt>
</p>
</td>
<td>
@ -973,50 +977,50 @@ cab
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\</span><span class="identifier">Z</span></code>
<tt class="computeroutput"><span class="special">\</span><span class="identifier">Z</span></tt>
</p>
</td>
<td>
<p>
Matches an optional sequence of newlines at the end of a buffer:
equivalent to the regular expression <code class="computeroutput"><span class="special">\</span><span class="identifier">n</span><span class="special">*\</span><span class="identifier">z</span></code>
equivalent to the regular expression <tt class="computeroutput"><span class="special">\</span><span class="identifier">n</span><span class="special">*\</span><span class="identifier">z</span></tt>
</p>
</td>
</tr>
</tbody>
</table></div>
<a name="boost_regex.syntax.basic_extended.continuation_escape"></a><h6>
<a name="id507819"></a>
<a name="boost_regex.syntax.basic_extended.continuation_escape"></a><h5>
<a name="id474144"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.continuation_escape">Continuation
Escape</a>
</h6>
</h5>
<p>
The sequence <code class="computeroutput"><span class="special">\</span><span class="identifier">G</span></code>
The sequence <tt class="computeroutput"><span class="special">\</span><span class="identifier">G</span></tt>
matches only at the end of the last match found, or at the start of the text
being matched if no previous match was found. This escape useful if you're
iterating over the matches contained within a text, and you want each subsequence
match to start where the last one ended.
</p>
<a name="boost_regex.syntax.basic_extended.quoting_escape"></a><h6>
<a name="id507869"></a>
<a name="boost_regex.syntax.basic_extended.quoting_escape"></a><h5>
<a name="id474196"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.quoting_escape">Quoting
escape</a>
</h6>
</h5>
<p>
The escape sequence <code class="computeroutput"><span class="special">\</span><span class="identifier">Q</span></code>
The escape sequence <tt class="computeroutput"><span class="special">\</span><span class="identifier">Q</span></tt>
begins a "quoted sequence": all the subsequent characters are treated
as literals, until either the end of the regular expression or <code class="computeroutput"><span class="special">\</span><span class="identifier">E</span></code> is found.
For example the expression: <code class="computeroutput"><span class="special">\</span><span class="identifier">Q</span><span class="special">\*+\</span><span class="identifier">Ea</span><span class="special">+</span></code> would match either of:
as literals, until either the end of the regular expression or <tt class="computeroutput"><span class="special">\</span><span class="identifier">E</span></tt> is found.
For example the expression: <tt class="computeroutput"><span class="special">\</span><span class="identifier">Q</span><span class="special">\*+\</span><span class="identifier">Ea</span><span class="special">+</span></tt> would match either of:
</p>
<pre class="programlisting">
<span class="special">\*+</span><span class="identifier">a</span>
<span class="special">\*+</span><span class="identifier">aaa</span>
</pre>
<a name="boost_regex.syntax.basic_extended.unicode_escapes"></a><h6>
<a name="id507993"></a>
<a name="boost_regex.syntax.basic_extended.unicode_escapes"></a><h5>
<a name="id474322"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.unicode_escapes">Unicode
escapes</a>
</h6>
</h5>
<div class="informaltable"><table class="table">
<colgroup>
<col>
@ -1038,7 +1042,7 @@ cab
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\</span><span class="identifier">C</span></code>
<tt class="computeroutput"><span class="special">\</span><span class="identifier">C</span></tt>
</p>
</td>
<td>
@ -1051,7 +1055,7 @@ cab
<tr>
<td>
<p>
<code class="computeroutput"><span class="special">\</span><span class="identifier">X</span></code>
<tt class="computeroutput"><span class="special">\</span><span class="identifier">X</span></tt>
</p>
</td>
<td>
@ -1063,40 +1067,40 @@ cab
</tr>
</tbody>
</table></div>
<a name="boost_regex.syntax.basic_extended.any_other_escape"></a><h6>
<a name="id508126"></a>
<a name="boost_regex.syntax.basic_extended.any_other_escape"></a><h5>
<a name="id474456"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.any_other_escape">Any other
escape</a>
</h6>
</h5>
<p>
Any other escape sequence matches the character that is escaped, for example
\@ matches a literal '@'.
</p>
<a name="boost_regex.syntax.basic_extended.operator_precedence"></a><h5>
<a name="id508156"></a>
<a name="boost_regex.syntax.basic_extended.operator_precedence"></a><h4>
<a name="id474488"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.operator_precedence">Operator
precedence</a>
</h5>
</h4>
<p>
The order of precedence for of operators is as follows:
</p>
<div class="orderedlist"><ol type="1">
<li>
Collation-related bracket symbols <code class="computeroutput"><span class="special">[==]</span>
<span class="special">[::]</span> <span class="special">[..]</span></code>
Collation-related bracket symbols <tt class="computeroutput"><span class="special">[==]</span>
<span class="special">[::]</span> <span class="special">[..]</span></tt>
</li>
<li>
Escaped characters <code class="computeroutput"><span class="special">\</span></code>
Escaped characters <tt class="computeroutput"><span class="special">\</span></tt>
</li>
<li>
Character set (bracket expression) <code class="computeroutput"><span class="special">[]</span></code>
Character set (bracket expression) <tt class="computeroutput"><span class="special">[]</span></tt>
</li>
<li>
Grouping <code class="computeroutput"><span class="special">()</span></code>
Grouping <tt class="computeroutput"><span class="special">()</span></tt>
</li>
<li>
Single-character-ERE duplication <code class="computeroutput"><span class="special">*</span>
<span class="special">+</span> <span class="special">?</span> <span class="special">{</span><span class="identifier">m</span><span class="special">,</span><span class="identifier">n</span><span class="special">}</span></code>
Single-character-ERE duplication <tt class="computeroutput"><span class="special">*</span>
<span class="special">+</span> <span class="special">?</span> <span class="special">{</span><span class="identifier">m</span><span class="special">,</span><span class="identifier">n</span><span class="special">}</span></tt>
</li>
<li>
Concatenation
@ -1105,30 +1109,31 @@ cab
Anchoring ^$
</li>
<li>
Alternation <code class="computeroutput"><span class="special">|</span></code>
Alternation <tt class="computeroutput"><span class="special">|</span></tt>
</li>
</ol></div>
<a name="boost_regex.syntax.basic_extended.what_gets_matched"></a><h5>
<a name="id508346"></a>
<a name="boost_regex.syntax.basic_extended.what_gets_matched"></a><h4>
<a name="id474680"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.what_gets_matched">What
Gets Matched</a>
</h5>
</h4>
<p>
When there is more that one way to match a regular expression, the "best"
possible match is obtained using the <a href="leftmost_longest_rule.html" title="The Leftmost Longest Rule">leftmost-longest
possible match is obtained using the <a href="leftmost_longest_rule.html" title=" The Leftmost
Longest Rule">leftmost-longest
rule</a>.
</p>
<a name="boost_regex.syntax.basic_extended.variations"></a><h4>
<a name="id508386"></a>
<a name="boost_regex.syntax.basic_extended.variations"></a><h3>
<a name="id474721"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.variations">Variations</a>
</h4>
<a name="boost_regex.syntax.basic_extended.egrep"></a><h5>
<a name="id508409"></a>
</h3>
<a name="boost_regex.syntax.basic_extended.egrep"></a><h4>
<a name="id474744"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.egrep">Egrep</a>
</h5>
</h4>
<p>
When an expression is compiled with the <a href="../ref/syntax_option_type.html" title="syntax_option_type">flag
<code class="computeroutput"><span class="identifier">egrep</span></code></a> set, then the
When an expression is compiled with the <a href="../ref/syntax_option_type.html" title=" syntax_option_type">flag
<tt class="computeroutput"><span class="identifier">egrep</span></tt></a> set, then the
expression is treated as a newline separated list of <a href="basic_extended.html#boost_regex.posix_extended_syntax">POSIX-Extended
expressions</a>, a match is found if any of the expressions in the list
match, for example:
@ -1141,13 +1146,13 @@ cab
</p>
<p>
As its name suggests, this behavior is consistent with the Unix utility
<code class="computeroutput"><span class="identifier">egrep</span></code>, and with grep when
<tt class="computeroutput"><span class="identifier">egrep</span></tt>, and with grep when
used with the -E option.
</p>
<a name="boost_regex.syntax.basic_extended.awk"></a><h5>
<a name="id508568"></a>
<a name="boost_regex.syntax.basic_extended.awk"></a><h4>
<a name="id474906"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.awk">awk</a>
</h5>
</h4>
<p>
In addition to the <a href="basic_extended.html#boost_regex.posix_extended_syntax">POSIX-Extended
features</a> the escape character is special inside a character class
@ -1158,23 +1163,26 @@ cab
specification are required to be supported - however Boost.Regex supports
these by default anyway.
</p>
<a name="boost_regex.syntax.basic_extended.options"></a><h4>
<a name="id508614"></a>
<a name="boost_regex.syntax.basic_extended.options"></a><h3>
<a name="id474953"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.options">Options</a>
</h4>
</h3>
<p>
There are a <a href="../ref/syntax_option_type/syntax_option_type_extended.html" title="Options for POSIX Extended Regular Expressions">variety
of flags</a> that may be combined with the <code class="computeroutput"><span class="identifier">extended</span></code>
and <code class="computeroutput"><span class="identifier">egrep</span></code> options when constructing
the regular expression, in particular note that the <a href="../ref/syntax_option_type/syntax_option_type_extended.html" title="Options for POSIX Extended Regular Expressions"><code class="computeroutput"><span class="identifier">newline_alt</span></code></a> option alters the syntax,
while the <a href="../ref/syntax_option_type/syntax_option_type_extended.html" title="Options for POSIX Extended Regular Expressions"><code class="computeroutput"><span class="identifier">collate</span></code>, <code class="computeroutput"><span class="identifier">nosubs</span></code>
and <code class="computeroutput"><span class="identifier">icase</span></code> options</a>
There are a <a href="../ref/syntax_option_type/syntax_option_type_extended.html" title="
Options for POSIX Extended Regular Expressions">variety
of flags</a> that may be combined with the <tt class="computeroutput"><span class="identifier">extended</span></tt>
and <tt class="computeroutput"><span class="identifier">egrep</span></tt> options when constructing
the regular expression, in particular note that the <a href="../ref/syntax_option_type/syntax_option_type_extended.html" title="
Options for POSIX Extended Regular Expressions"><tt class="computeroutput"><span class="identifier">newline_alt</span></tt></a> option alters the syntax,
while the <a href="../ref/syntax_option_type/syntax_option_type_extended.html" title="
Options for POSIX Extended Regular Expressions"><tt class="computeroutput"><span class="identifier">collate</span></tt>, <tt class="computeroutput"><span class="identifier">nosubs</span></tt>
and <tt class="computeroutput"><span class="identifier">icase</span></tt> options</a>
modify how the case and locale sensitivity are to be applied.
</p>
<a name="boost_regex.syntax.basic_extended.references"></a><h4>
<a name="id508743"></a>
<a name="boost_regex.syntax.basic_extended.references"></a><h3>
<a name="id475084"></a>
<a href="basic_extended.html#boost_regex.syntax.basic_extended.references">References</a>
</h4>
</h3>
<p>
<a href="http://www.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap09.html" target="_top">IEEE
Std 1003.1-2001, Portable Operating System Interface (POSIX ), Base Definitions
@ -1193,7 +1201,10 @@ cab
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><small>Copyright <20> 2007 John Maddock</small></td>
<td align="right"><div class="copyright-footer"><small>Copyright <20> 2007 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p></small></div></td>
</tr></table>
<hr>
<div class="spirit-nav">

View File

@ -1,13 +1,16 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>POSIX Basic Regular Expression Syntax</title>
<title> POSIX Basic Regular
Expression Syntax</title>
<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
<link rel="start" href="../../index.html" title="Boost.Regex">
<link rel="up" href="../syntax.html" title="Regular Expression Syntax">
<link rel="prev" href="basic_extended.html" title="POSIX Extended Regular Expression Syntax">
<link rel="next" href="character_classes.html" title="Character Class Names">
<link rel="up" href="../syntax.html" title=" Regular Expression Syntax">
<link rel="prev" href="basic_extended.html" title=" POSIX Extended Regular
Expression Syntax">
<link rel="next" href="character_classes.html" title=" Character Class
Names">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@ -24,18 +27,18 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.syntax.basic_syntax"></a><a href="basic_syntax.html" title="POSIX Basic Regular Expression Syntax"> POSIX Basic Regular
Expression Syntax</a>
</h3></div></div></div>
<a name="boost_regex.syntax.basic_syntax.synopsis"></a><h4>
<a name="id508828"></a>
<a name="boost_regex.syntax.basic_syntax"></a><a href="basic_syntax.html" title=" POSIX Basic Regular
Expression Syntax"> POSIX Basic Regular
Expression Syntax</a></h3></div></div></div>
<a name="boost_regex.syntax.basic_syntax.synopsis"></a><h3>
<a name="id475172"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.synopsis">Synopsis</a>
</h4>
</h3>
<p>
The POSIX-Basic regular expression syntax is used by the Unix utility <code class="computeroutput"><span class="identifier">sed</span></code>, and variations are used by <code class="computeroutput"><span class="identifier">grep</span></code> and <code class="computeroutput"><span class="identifier">emacs</span></code>.
The POSIX-Basic regular expression syntax is used by the Unix utility <tt class="computeroutput"><span class="identifier">sed</span></tt>, and variations are used by <tt class="computeroutput"><span class="identifier">grep</span></tt> and <tt class="computeroutput"><span class="identifier">emacs</span></tt>.
You can construct POSIX basic regular expressions in Boost.Regex by passing
the flag <code class="computeroutput"><span class="identifier">basic</span></code> to the regex
constructor (see <a href="../ref/syntax_option_type.html" title="syntax_option_type"><code class="computeroutput"><span class="identifier">syntax_option_type</span></code></a>), for example:
the flag <tt class="computeroutput"><span class="identifier">basic</span></tt> to the regex
constructor (see <a href="../ref/syntax_option_type.html" title=" syntax_option_type"><tt class="computeroutput"><span class="identifier">syntax_option_type</span></tt></a>), for example:
</p>
<pre class="programlisting">
<span class="comment">// e1 is a case sensitive POSIX-Basic expression:
@ -45,38 +48,38 @@
</pre>
<a name="boost_regex.posix_basic"></a><p>
</p>
<a name="boost_regex.syntax.basic_syntax.posix_basic_syntax"></a><h4>
<a name="id509121"></a>
<a name="boost_regex.syntax.basic_syntax.posix_basic_syntax"></a><h3>
<a name="id475467"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.posix_basic_syntax">POSIX
Basic Syntax</a>
</h4>
</h3>
<p>
In POSIX-Basic regular expressions, all characters are match themselves except
for the following special characters:
</p>
<pre class="programlisting">.[\*^$</pre>
<a name="boost_regex.syntax.basic_syntax.wildcard_"></a><h5>
<a name="id509160"></a>
<a name="boost_regex.syntax.basic_syntax.wildcard_"></a><h4>
<a name="id475508"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.wildcard_">Wildcard:</a>
</h5>
</h4>
<p>
The single character '.' when used outside of a character set will match
any single character except:
</p>
<div class="itemizedlist"><ul type="disc">
<li>
The NULL character when the flag <code class="computeroutput"><span class="identifier">match_no_dot_null</span></code>
The NULL character when the flag <tt class="computeroutput"><span class="identifier">match_no_dot_null</span></tt>
is passed to the matching algorithms.
</li>
<li>
The newline character when the flag <code class="computeroutput"><span class="identifier">match_not_dot_newline</span></code>
The newline character when the flag <tt class="computeroutput"><span class="identifier">match_not_dot_newline</span></tt>
is passed to the matching algorithms.
</li>
</ul></div>
<a name="boost_regex.syntax.basic_syntax.anchors_"></a><h5>
<a name="id509229"></a>
<a name="boost_regex.syntax.basic_syntax.anchors_"></a><h4>
<a name="id475578"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.anchors_">Anchors:</a>
</h5>
</h4>
<p>
A '^' character shall match the start of a line when used as the first character
of an expression, or the first character of a sub-expression.
@ -85,30 +88,30 @@
A '$' character shall match the end of a line when used as the last character
of an expression, or the last character of a sub-expression.
</p>
<a name="boost_regex.syntax.basic_syntax.marked_sub_expressions_"></a><h5>
<a name="id509266"></a>
<a name="boost_regex.syntax.basic_syntax.marked_sub_expressions_"></a><h4>
<a name="id475615"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.marked_sub_expressions_">Marked
sub-expressions:</a>
</h5>
</h4>
<p>
A section beginning <code class="computeroutput"><span class="special">\(</span></code> and ending
<code class="computeroutput"><span class="special">\)</span></code> acts as a marked sub-expression.
A section beginning <tt class="computeroutput"><span class="special">\(</span></tt> and ending
<tt class="computeroutput"><span class="special">\)</span></tt> acts as a marked sub-expression.
Whatever matched the sub-expression is split out in a separate field by the
matching algorithms. Marked sub-expressions can also repeated, or referred-to
by a back-reference.
</p>
<a name="boost_regex.syntax.basic_syntax.repeats_"></a><h5>
<a name="id509322"></a>
<a name="boost_regex.syntax.basic_syntax.repeats_"></a><h4>
<a name="id475674"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.repeats_">Repeats:</a>
</h5>
</h4>
<p>
Any atom (a single character, a marked sub-expression, or a character class)
can be repeated with the * operator.
</p>
<p>
For example <code class="computeroutput"><span class="identifier">a</span><span class="special">*</span></code>
For example <tt class="computeroutput"><span class="identifier">a</span><span class="special">*</span></tt>
will match any number of letter a's repeated zero or more times (an atom
repeated zero times matches an empty string), so the expression <code class="computeroutput"><span class="identifier">a</span><span class="special">*</span><span class="identifier">b</span></code>
repeated zero times matches an empty string), so the expression <tt class="computeroutput"><span class="identifier">a</span><span class="special">*</span><span class="identifier">b</span></tt>
will match any of the following:
</p>
<pre class="programlisting">b
@ -119,15 +122,15 @@ aaaaaaaab
An atom can also be repeated with a bounded repeat:
</p>
<p>
<code class="computeroutput"><span class="identifier">a</span><span class="special">\{</span><span class="identifier">n</span><span class="special">\}</span></code> Matches
<tt class="computeroutput"><span class="identifier">a</span><span class="special">\{</span><span class="identifier">n</span><span class="special">\}</span></tt> Matches
'a' repeated exactly n times.
</p>
<p>
<code class="computeroutput"><span class="identifier">a</span><span class="special">\{</span><span class="identifier">n</span><span class="special">,\}</span></code> Matches
<tt class="computeroutput"><span class="identifier">a</span><span class="special">\{</span><span class="identifier">n</span><span class="special">,\}</span></tt> Matches
'a' repeated n or more times.
</p>
<p>
<code class="computeroutput"><span class="identifier">a</span><span class="special">\{</span><span class="identifier">n</span><span class="special">,</span> <span class="identifier">m</span><span class="special">\}</span></code> Matches 'a' repeated between n and m times
<tt class="computeroutput"><span class="identifier">a</span><span class="special">\{</span><span class="identifier">n</span><span class="special">,</span> <span class="identifier">m</span><span class="special">\}</span></tt> Matches 'a' repeated between n and m times
inclusive.
</p>
<p>
@ -155,10 +158,10 @@ aaaa
Will raise an error, as there is nothing for the * operator to be applied
to.
</p>
<a name="boost_regex.syntax.basic_syntax.back_references_"></a><h5>
<a name="id509566"></a>
<a name="boost_regex.syntax.basic_syntax.back_references_"></a><h4>
<a name="id475920"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.back_references_">Back references:</a>
</h5>
</h4>
<p>
An escape character followed by a digit <span class="emphasis"><em>n</em></span>, where <span class="emphasis"><em>n</em></span>
is in the range 1-9, matches the same string that was matched by sub-expression
@ -173,11 +176,11 @@ aaaa
But not the string:
</p>
<pre class="programlisting">aaabba</pre>
<a name="boost_regex.syntax.basic_syntax.character_sets_"></a><h5>
<a name="id509641"></a>
<a name="boost_regex.syntax.basic_syntax.character_sets_"></a><h4>
<a name="id475996"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.character_sets_">Character
sets:</a>
</h5>
</h4>
<p>
A character set is a bracket-expression starting with [ and ending with ],
it defines a set of characters, and matches any single character that is
@ -186,68 +189,69 @@ aaaa
<p>
A bracket expression may contain any combination of the following:
</p>
<a name="boost_regex.syntax.basic_syntax.single_characters_"></a><h6>
<a name="id509677"></a>
<a name="boost_regex.syntax.basic_syntax.single_characters_"></a><h5>
<a name="id476034"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.single_characters_">Single
characters:</a>
</h6>
</h5>
<p>
For example <code class="computeroutput"><span class="special">[</span><span class="identifier">abc</span><span class="special">]</span></code>, will match any of the characters 'a', 'b',
For example <tt class="computeroutput"><span class="special">[</span><span class="identifier">abc</span><span class="special">]</span></tt>, will match any of the characters 'a', 'b',
or 'c'.
</p>
<a name="boost_regex.syntax.basic_syntax.character_ranges_"></a><h6>
<a name="id509727"></a>
<a name="boost_regex.syntax.basic_syntax.character_ranges_"></a><h5>
<a name="id476086"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.character_ranges_">Character
ranges:</a>
</h6>
</h5>
<p>
For example <code class="computeroutput"><span class="special">[</span><span class="identifier">a</span><span class="special">-</span><span class="identifier">c</span><span class="special">]</span></code>
For example <tt class="computeroutput"><span class="special">[</span><span class="identifier">a</span><span class="special">-</span><span class="identifier">c</span><span class="special">]</span></tt>
will match any single character in the range 'a' to 'c'. By default, for
POSIX-Basic regular expressions, a character <span class="emphasis"><em>x</em></span> is within
the range <span class="emphasis"><em>y</em></span> to <span class="emphasis"><em>z</em></span>, if it collates
within that range; this results in locale specific behavior. This behavior
can be turned off by unsetting the <code class="computeroutput"><span class="identifier">collate</span></code>
can be turned off by unsetting the <tt class="computeroutput"><span class="identifier">collate</span></tt>
option flag when constructing the regular expression - in which case whether
a character appears within a range is determined by comparing the code points
of the characters only.
</p>
<a name="boost_regex.syntax.basic_syntax.negation_"></a><h6>
<a name="id509818"></a>
<a name="boost_regex.syntax.basic_syntax.negation_"></a><h5>
<a name="id476179"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.negation_">Negation:</a>
</h6>
</h5>
<p>
If the bracket-expression begins with the ^ character, then it matches the
complement of the characters it contains, for example <code class="computeroutput"><span class="special">[^</span><span class="identifier">a</span><span class="special">-</span><span class="identifier">c</span><span class="special">]</span></code> matches any character that is not in the
complement of the characters it contains, for example <tt class="computeroutput"><span class="special">[^</span><span class="identifier">a</span><span class="special">-</span><span class="identifier">c</span><span class="special">]</span></tt> matches any character that is not in the
range a-c.
</p>
<a name="boost_regex.syntax.basic_syntax.character_classes_"></a><h6>
<a name="id509879"></a>
<a name="boost_regex.syntax.basic_syntax.character_classes_"></a><h5>
<a name="id476241"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.character_classes_">Character
classes:</a>
</h6>
</h5>
<p>
An expression of the form <code class="computeroutput"><span class="special">[[:</span><span class="identifier">name</span><span class="special">:]]</span></code>
matches the named character class "name", for example <code class="computeroutput"><span class="special">[[:</span><span class="identifier">lower</span><span class="special">:]]</span></code> matches any lower case character. See
<a href="character_classes.html" title="Character Class Names">character class names</a>.
An expression of the form <tt class="computeroutput"><span class="special">[[:</span><span class="identifier">name</span><span class="special">:]]</span></tt>
matches the named character class "name", for example <tt class="computeroutput"><span class="special">[[:</span><span class="identifier">lower</span><span class="special">:]]</span></tt> matches any lower case character. See
<a href="character_classes.html" title=" Character Class
Names">character class names</a>.
</p>
<a name="boost_regex.syntax.basic_syntax.collating_elements_"></a><h6>
<a name="id509963"></a>
<a name="boost_regex.syntax.basic_syntax.collating_elements_"></a><h5>
<a name="id476326"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.collating_elements_">Collating
Elements:</a>
</h6>
</h5>
<p>
An expression of the form <code class="computeroutput"><span class="special">[[.</span><span class="identifier">col</span><span class="special">.]</span></code> matches
An expression of the form <tt class="computeroutput"><span class="special">[[.</span><span class="identifier">col</span><span class="special">.]</span></tt> matches
the collating element <span class="emphasis"><em>col</em></span>. A collating element is any
single character, or any sequence of characters that collates as a single
unit. Collating elements may also be used as the end point of a range, for
example: <code class="computeroutput"><span class="special">[[.</span><span class="identifier">ae</span><span class="special">.]-</span><span class="identifier">c</span><span class="special">]</span></code>
example: <tt class="computeroutput"><span class="special">[[.</span><span class="identifier">ae</span><span class="special">.]-</span><span class="identifier">c</span><span class="special">]</span></tt>
matches the character sequence "ae", plus any single character
in the rangle "ae"-c, assuming that "ae" is treated as
a single collating element in the current locale.
</p>
<p>
Collating elements may be used in place of escapes (which are not normally
allowed inside character sets), for example <code class="computeroutput"><span class="special">[[.^.]</span><span class="identifier">abc</span><span class="special">]</span></code> would
allowed inside character sets), for example <tt class="computeroutput"><span class="special">[[.^.]</span><span class="identifier">abc</span><span class="special">]</span></tt> would
match either one of the characters 'abc^'.
</p>
<p>
@ -256,38 +260,38 @@ aaaa
</p>
<pre class="programlisting">[[.NUL.]]</pre>
<p>
matches a 'NUL' character. See <a href="collating_names.html" title="Collating Names">collating
matches a 'NUL' character. See <a href="collating_names.html" title=" Collating Names">collating
element names</a>.
</p>
<a name="boost_regex.syntax.basic_syntax.equivalence_classes_"></a><h6>
<a name="id510111"></a>
<a name="boost_regex.syntax.basic_syntax.equivalence_classes_"></a><h5>
<a name="id476472"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.equivalence_classes_">Equivalence
classes:</a>
</h6>
</h5>
<p>
An expression of theform <code class="computeroutput"><span class="special">[[=</span><span class="identifier">col</span><span class="special">=]]</span></code>,
An expression of theform <tt class="computeroutput"><span class="special">[[=</span><span class="identifier">col</span><span class="special">=]]</span></tt>,
matches any character or collating element whose primary sort key is the
same as that for collating element <span class="emphasis"><em>col</em></span>, as with collating
elements the name <span class="emphasis"><em>col</em></span> may be a <a href="collating_names.html" title="Collating Names">collating
elements the name <span class="emphasis"><em>col</em></span> may be a <a href="collating_names.html" title=" Collating Names">collating
symbolic name</a>. A primary sort key is one that ignores case, accentation,
or locale-specific tailorings; so for example <code class="computeroutput"><span class="special">[[=</span><span class="identifier">a</span><span class="special">=]]</span></code> matches
or locale-specific tailorings; so for example <tt class="computeroutput"><span class="special">[[=</span><span class="identifier">a</span><span class="special">=]]</span></tt> matches
any of the characters: a, <20>, <20>, <20>, <20>, <20>, <20>, A, <20>, <20>, <20>, <20>, <20> and <20>. Unfortunately implementation
of this is reliant on the platform's collation and localisation support;
this feature can not be relied upon to work portably across all platforms,
or even all locales on one platform.
</p>
<a name="boost_regex.syntax.basic_syntax.combinations_"></a><h6>
<a name="id510216"></a>
<a name="boost_regex.syntax.basic_syntax.combinations_"></a><h5>
<a name="id476585"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.combinations_">Combinations:</a>
</h6>
</h5>
<p>
All of the above can be combined in one character set declaration, for example:
<code class="computeroutput"><span class="special">[[:</span><span class="identifier">digit</span><span class="special">:]</span><span class="identifier">a</span><span class="special">-</span><span class="identifier">c</span><span class="special">[.</span><span class="identifier">NUL</span><span class="special">.]].</span></code>
<tt class="computeroutput"><span class="special">[[:</span><span class="identifier">digit</span><span class="special">:]</span><span class="identifier">a</span><span class="special">-</span><span class="identifier">c</span><span class="special">[.</span><span class="identifier">NUL</span><span class="special">.]].</span></tt>
</p>
<a name="boost_regex.syntax.basic_syntax.escapes"></a><h5>
<a name="id510295"></a>
<a name="boost_regex.syntax.basic_syntax.escapes"></a><h4>
<a name="id476664"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.escapes">Escapes</a>
</h5>
</h4>
<p>
With the exception of the escape sequences \{, \}, \(, and \), which are
documented above, an escape followed by any character matches that character.
@ -296,31 +300,32 @@ aaaa
<pre class="programlisting">.[\*^$</pre>
<p>
"ordinary". Note that the escape character loses its special meaning
inside a character set, so <code class="computeroutput"><span class="special">[\^]</span></code>
inside a character set, so <tt class="computeroutput"><span class="special">[\^]</span></tt>
will match either a literal '\' or a '^'.
</p>
<a name="boost_regex.syntax.basic_syntax.what_gets_matched"></a><h4>
<a name="id510351"></a>
<a name="boost_regex.syntax.basic_syntax.what_gets_matched"></a><h3>
<a name="id476723"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.what_gets_matched">What Gets
Matched</a>
</h4>
</h3>
<p>
When there is more that one way to match a regular expression, the "best"
possible match is obtained using the <a href="leftmost_longest_rule.html" title="The Leftmost Longest Rule">leftmost-longest
possible match is obtained using the <a href="leftmost_longest_rule.html" title=" The Leftmost
Longest Rule">leftmost-longest
rule</a>.
</p>
<a name="boost_regex.syntax.basic_syntax.variations"></a><h4>
<a name="id510390"></a>
<a name="boost_regex.syntax.basic_syntax.variations"></a><h3>
<a name="id476764"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.variations">Variations</a>
</h4>
</h3>
<a name="boost_regex.grep_syntax"></a><p>
</p>
<a name="boost_regex.syntax.basic_syntax.grep"></a><h5>
<a name="id510423"></a>
<a name="boost_regex.syntax.basic_syntax.grep"></a><h4>
<a name="id476798"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.grep">Grep</a>
</h5>
</h4>
<p>
When an expression is compiled with the flag <code class="computeroutput"><span class="identifier">grep</span></code>
When an expression is compiled with the flag <tt class="computeroutput"><span class="identifier">grep</span></tt>
set, then the expression is treated as a newline separated list of <a href="basic_syntax.html#boost_regex.posix_basic">POSIX-Basic expressions</a>, a match
is found if any of the expressions in the list match, for example:
</p>
@ -334,10 +339,10 @@ aaaa
<p>
As its name suggests, this behavior is consistent with the Unix utility grep.
</p>
<a name="boost_regex.syntax.basic_syntax.emacs"></a><h5>
<a name="id510568"></a>
<a name="boost_regex.syntax.basic_syntax.emacs"></a><h4>
<a name="id476945"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.emacs">emacs</a>
</h5>
</h4>
<p>
In addition to the <a href="basic_syntax.html#boost_regex.posix_basic">POSIX-Basic features</a>
the following characters are also special:
@ -611,27 +616,31 @@ aaaa
according to the <a href="perl_syntax.html#boost_regex.syntax.perl_syntax.what_gets_matched">Perl
"depth first search" rules</a>. Emacs expressions are matched
this way because they contain Perl-like extensions, that do not interact
well with the <a href="leftmost_longest_rule.html" title="The Leftmost Longest Rule">POSIX-style
well with the <a href="leftmost_longest_rule.html" title=" The Leftmost
Longest Rule">POSIX-style
leftmost-longest rule</a>.
</p>
<a name="boost_regex.syntax.basic_syntax.options"></a><h4>
<a name="id511063"></a>
<a name="boost_regex.syntax.basic_syntax.options"></a><h3>
<a name="id477441"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.options">Options</a>
</h4>
</h3>
<p>
There are a <a href="../ref/syntax_option_type/syntax_option_type_basic.html" title="Options for POSIX Basic Regular Expressions">variety
of flags</a> that may be combined with the <code class="computeroutput"><span class="identifier">basic</span></code>
and <code class="computeroutput"><span class="identifier">grep</span></code> options when constructing
the regular expression, in particular note that the <a href="../ref/syntax_option_type/syntax_option_type_basic.html" title="Options for POSIX Basic Regular Expressions"><code class="computeroutput"><span class="identifier">newline_alt</span></code>, <code class="computeroutput"><span class="identifier">no_char_classes</span></code>,
<code class="computeroutput"><span class="identifier">no</span><span class="special">-</span><span class="identifier">intervals</span></code>, <code class="computeroutput"><span class="identifier">bk_plus_qm</span></code>
and <code class="computeroutput"><span class="identifier">bk_plus_vbar</span></code></a> options
all alter the syntax, while the <a href="../ref/syntax_option_type/syntax_option_type_basic.html" title="Options for POSIX Basic Regular Expressions"><code class="computeroutput"><span class="identifier">collate</span></code> and <code class="computeroutput"><span class="identifier">icase</span></code>
There are a <a href="../ref/syntax_option_type/syntax_option_type_basic.html" title="
Options for POSIX Basic Regular Expressions">variety
of flags</a> that may be combined with the <tt class="computeroutput"><span class="identifier">basic</span></tt>
and <tt class="computeroutput"><span class="identifier">grep</span></tt> options when constructing
the regular expression, in particular note that the <a href="../ref/syntax_option_type/syntax_option_type_basic.html" title="
Options for POSIX Basic Regular Expressions"><tt class="computeroutput"><span class="identifier">newline_alt</span></tt>, <tt class="computeroutput"><span class="identifier">no_char_classes</span></tt>,
<tt class="computeroutput"><span class="identifier">no</span><span class="special">-</span><span class="identifier">intervals</span></tt>, <tt class="computeroutput"><span class="identifier">bk_plus_qm</span></tt>
and <tt class="computeroutput"><span class="identifier">bk_plus_vbar</span></tt></a> options
all alter the syntax, while the <a href="../ref/syntax_option_type/syntax_option_type_basic.html" title="
Options for POSIX Basic Regular Expressions"><tt class="computeroutput"><span class="identifier">collate</span></tt> and <tt class="computeroutput"><span class="identifier">icase</span></tt>
options</a> modify how the case and locale sensitivity are to be applied.
</p>
<a name="boost_regex.syntax.basic_syntax.references"></a><h4>
<a name="id511236"></a>
<a name="boost_regex.syntax.basic_syntax.references"></a><h3>
<a name="id477617"></a>
<a href="basic_syntax.html#boost_regex.syntax.basic_syntax.references">References</a>
</h4>
</h3>
<p>
<a href="http://www.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap09.html" target="_top">IEEE
Std 1003.1-2001, Portable Operating System Interface (POSIX ), Base Definitions
@ -648,7 +657,10 @@ aaaa
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><small>Copyright <20> 2007 John Maddock</small></td>
<td align="right"><div class="copyright-footer"><small>Copyright <20> 2007 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p></small></div></td>
</tr></table>
<hr>
<div class="spirit-nav">

View File

@ -1,13 +1,16 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Character Class Names</title>
<title> Character Class
Names</title>
<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
<link rel="start" href="../../index.html" title="Boost.Regex">
<link rel="up" href="../syntax.html" title="Regular Expression Syntax">
<link rel="prev" href="basic_syntax.html" title="POSIX Basic Regular Expression Syntax">
<link rel="next" href="character_classes/std_char_clases.html" title="Character Classes that are Always Supported">
<link rel="up" href="../syntax.html" title=" Regular Expression Syntax">
<link rel="prev" href="basic_syntax.html" title=" POSIX Basic Regular
Expression Syntax">
<link rel="next" href="character_classes/std_char_clases.html" title="
Character Classes that are Always Supported">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@ -24,9 +27,9 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.syntax.character_classes"></a><a href="character_classes.html" title="Character Class Names"> Character Class
Names</a>
</h3></div></div></div>
<a name="boost_regex.syntax.character_classes"></a><a href="character_classes.html" title=" Character Class
Names"> Character Class
Names</a></h3></div></div></div>
<div class="toc"><dl>
<dt><span class="section"><a href="character_classes/std_char_clases.html">
Character Classes that are Always Supported</a></span></dt>
@ -36,7 +39,10 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><small>Copyright <20> 2007 John Maddock</small></td>
<td align="right"><div class="copyright-footer"><small>Copyright <20> 2007 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p></small></div></td>
</tr></table>
<hr>
<div class="spirit-nav">

View File

@ -1,13 +1,16 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Character classes that are supported by Unicode Regular Expressions</title>
<title>
Character classes that are supported by Unicode Regular Expressions</title>
<link rel="stylesheet" href="../../../../../../../doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
<link rel="start" href="../../../index.html" title="Boost.Regex">
<link rel="up" href="../character_classes.html" title="Character Class Names">
<link rel="prev" href="std_char_clases.html" title="Character Classes that are Always Supported">
<link rel="next" href="../collating_names.html" title="Collating Names">
<link rel="up" href="../character_classes.html" title=" Character Class
Names">
<link rel="prev" href="std_char_clases.html" title="
Character Classes that are Always Supported">
<link rel="next" href="../collating_names.html" title=" Collating Names">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@ -24,12 +27,12 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_regex.syntax.character_classes.optional_char_class_names"></a><a href="optional_char_class_names.html" title="Character classes that are supported by Unicode Regular Expressions">
Character classes that are supported by Unicode Regular Expressions</a>
</h4></div></div></div>
<a name="boost_regex.syntax.character_classes.optional_char_class_names"></a><a href="optional_char_class_names.html" title="
Character classes that are supported by Unicode Regular Expressions">
Character classes that are supported by Unicode Regular Expressions</a></h4></div></div></div>
<p>
The following character classes are only supported by Unicode Regular Expressions:
that is those that use the <code class="computeroutput"><span class="identifier">u32regex</span></code>
that is those that use the <tt class="computeroutput"><span class="identifier">u32regex</span></tt>
type. The names used are the same as those from Chapter 4 of the Unicode
standard.
</p>
@ -533,7 +536,10 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><small>Copyright <20> 2007 John Maddock</small></td>
<td align="right"><div class="copyright-footer"><small>Copyright <20> 2007 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p></small></div></td>
</tr></table>
<hr>
<div class="spirit-nav">

View File

@ -1,13 +1,17 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Character Classes that are Always Supported</title>
<title>
Character Classes that are Always Supported</title>
<link rel="stylesheet" href="../../../../../../../doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
<link rel="start" href="../../../index.html" title="Boost.Regex">
<link rel="up" href="../character_classes.html" title="Character Class Names">
<link rel="prev" href="../character_classes.html" title="Character Class Names">
<link rel="next" href="optional_char_class_names.html" title="Character classes that are supported by Unicode Regular Expressions">
<link rel="up" href="../character_classes.html" title=" Character Class
Names">
<link rel="prev" href="../character_classes.html" title=" Character Class
Names">
<link rel="next" href="optional_char_class_names.html" title="
Character classes that are supported by Unicode Regular Expressions">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@ -24,9 +28,9 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_regex.syntax.character_classes.std_char_clases"></a><a href="std_char_clases.html" title="Character Classes that are Always Supported">
Character Classes that are Always Supported</a>
</h4></div></div></div>
<a name="boost_regex.syntax.character_classes.std_char_clases"></a><a href="std_char_clases.html" title="
Character Classes that are Always Supported">
Character Classes that are Always Supported</a></h4></div></div></div>
<p>
The following character class names are always supported by Boost.Regex:
</p>
@ -382,7 +386,10 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><small>Copyright <20> 2007 John Maddock</small></td>
<td align="right"><div class="copyright-footer"><small>Copyright <20> 2007 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p></small></div></td>
</tr></table>
<hr>
<div class="spirit-nav">

View File

@ -1,13 +1,14 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Collating Names</title>
<title> Collating Names</title>
<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
<link rel="start" href="../../index.html" title="Boost.Regex">
<link rel="up" href="../syntax.html" title="Regular Expression Syntax">
<link rel="prev" href="character_classes/optional_char_class_names.html" title="Character classes that are supported by Unicode Regular Expressions">
<link rel="next" href="collating_names/digraphs.html" title="Digraphs">
<link rel="up" href="../syntax.html" title=" Regular Expression Syntax">
<link rel="prev" href="character_classes/optional_char_class_names.html" title="
Character classes that are supported by Unicode Regular Expressions">
<link rel="next" href="collating_names/digraphs.html" title=" Digraphs">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@ -24,8 +25,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.syntax.collating_names"></a><a href="collating_names.html" title="Collating Names"> Collating Names</a>
</h3></div></div></div>
<a name="boost_regex.syntax.collating_names"></a><a href="collating_names.html" title=" Collating Names"> Collating Names</a></h3></div></div></div>
<div class="toc"><dl>
<dt><span class="section"><a href="collating_names/digraphs.html"> Digraphs</a></span></dt>
<dt><span class="section"><a href="collating_names/posix_symbolic_names.html">
@ -36,7 +36,10 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><small>Copyright <20> 2007 John Maddock</small></td>
<td align="right"><div class="copyright-footer"><small>Copyright <20> 2007 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p></small></div></td>
</tr></table>
<hr>
<div class="spirit-nav">

View File

@ -1,13 +1,14 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Digraphs</title>
<title> Digraphs</title>
<link rel="stylesheet" href="../../../../../../../doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
<link rel="start" href="../../../index.html" title="Boost.Regex">
<link rel="up" href="../collating_names.html" title="Collating Names">
<link rel="prev" href="../collating_names.html" title="Collating Names">
<link rel="next" href="posix_symbolic_names.html" title="POSIX Symbolic Names">
<link rel="up" href="../collating_names.html" title=" Collating Names">
<link rel="prev" href="../collating_names.html" title=" Collating Names">
<link rel="next" href="posix_symbolic_names.html" title="
POSIX Symbolic Names">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@ -24,8 +25,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_regex.syntax.collating_names.digraphs"></a><a href="digraphs.html" title="Digraphs"> Digraphs</a>
</h4></div></div></div>
<a name="boost_regex.syntax.collating_names.digraphs"></a><a href="digraphs.html" title=" Digraphs"> Digraphs</a></h4></div></div></div>
<p>
The following are treated as valid digraphs when used as a collating name:
</p>
@ -47,7 +47,10 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><small>Copyright <20> 2007 John Maddock</small></td>
<td align="right"><div class="copyright-footer"><small>Copyright <20> 2007 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p></small></div></td>
</tr></table>
<hr>
<div class="spirit-nav">

View File

@ -1,13 +1,16 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Named Unicode Characters</title>
<title>
Named Unicode Characters</title>
<link rel="stylesheet" href="../../../../../../../doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
<link rel="start" href="../../../index.html" title="Boost.Regex">
<link rel="up" href="../collating_names.html" title="Collating Names">
<link rel="prev" href="posix_symbolic_names.html" title="POSIX Symbolic Names">
<link rel="next" href="../leftmost_longest_rule.html" title="The Leftmost Longest Rule">
<link rel="up" href="../collating_names.html" title=" Collating Names">
<link rel="prev" href="posix_symbolic_names.html" title="
POSIX Symbolic Names">
<link rel="next" href="../leftmost_longest_rule.html" title=" The Leftmost
Longest Rule">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@ -24,12 +27,12 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_regex.syntax.collating_names.named_unicode"></a><a href="named_unicode.html" title="Named Unicode Characters">
Named Unicode Characters</a>
</h4></div></div></div>
<a name="boost_regex.syntax.collating_names.named_unicode"></a><a href="named_unicode.html" title="
Named Unicode Characters">
Named Unicode Characters</a></h4></div></div></div>
<p>
When using <a href="../../unicode.html" title="Unicode and Boost.Regex">Unicode aware regular expressions</a>
(with the <code class="computeroutput"><span class="identifier">u32regex</span></code> type),
When using <a href="../../unicode.html" title=" Unicode and Boost.Regex">Unicode aware regular expressions</a>
(with the <tt class="computeroutput"><span class="identifier">u32regex</span></tt> type),
all the normal symbolic names for Unicode characters (those given in Unidata.txt)
are recognised. So for example:
</p>
@ -40,7 +43,10 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><small>Copyright <20> 2007 John Maddock</small></td>
<td align="right"><div class="copyright-footer"><small>Copyright <20> 2007 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p></small></div></td>
</tr></table>
<hr>
<div class="spirit-nav">

View File

@ -1,13 +1,15 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>POSIX Symbolic Names</title>
<title>
POSIX Symbolic Names</title>
<link rel="stylesheet" href="../../../../../../../doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
<link rel="start" href="../../../index.html" title="Boost.Regex">
<link rel="up" href="../collating_names.html" title="Collating Names">
<link rel="prev" href="digraphs.html" title="Digraphs">
<link rel="next" href="named_unicode.html" title="Named Unicode Characters">
<link rel="up" href="../collating_names.html" title=" Collating Names">
<link rel="prev" href="digraphs.html" title=" Digraphs">
<link rel="next" href="named_unicode.html" title="
Named Unicode Characters">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@ -24,9 +26,9 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_regex.syntax.collating_names.posix_symbolic_names"></a><a href="posix_symbolic_names.html" title="POSIX Symbolic Names">
POSIX Symbolic Names</a>
</h4></div></div></div>
<a name="boost_regex.syntax.collating_names.posix_symbolic_names"></a><a href="posix_symbolic_names.html" title="
POSIX Symbolic Names">
POSIX Symbolic Names</a></h4></div></div></div>
<p>
The following symbolic names are recognised as valid collating element
names, in addition to any single character, this allows you to write for
@ -971,7 +973,10 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><small>Copyright <20> 2007 John Maddock</small></td>
<td align="right"><div class="copyright-footer"><small>Copyright <20> 2007 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p></small></div></td>
</tr></table>
<hr>
<div class="spirit-nav">

View File

@ -1,13 +1,15 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>The Leftmost Longest Rule</title>
<title> The Leftmost
Longest Rule</title>
<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
<link rel="start" href="../../index.html" title="Boost.Regex">
<link rel="up" href="../syntax.html" title="Regular Expression Syntax">
<link rel="prev" href="collating_names/named_unicode.html" title="Named Unicode Characters">
<link rel="next" href="../format.html" title="Search and Replace Format String Syntax">
<link rel="up" href="../syntax.html" title=" Regular Expression Syntax">
<link rel="prev" href="collating_names/named_unicode.html" title="
Named Unicode Characters">
<link rel="next" href="../format.html" title=" Search and Replace Format String Syntax">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@ -24,9 +26,9 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.syntax.leftmost_longest_rule"></a><a href="leftmost_longest_rule.html" title="The Leftmost Longest Rule"> The Leftmost
Longest Rule</a>
</h3></div></div></div>
<a name="boost_regex.syntax.leftmost_longest_rule"></a><a href="leftmost_longest_rule.html" title=" The Leftmost
Longest Rule"> The Leftmost
Longest Rule</a></h3></div></div></div>
<p>
Often there is more than one way of matching a regular expression at a particular
location, for POSIX basic and extended regular expressions, the "best"
@ -65,7 +67,10 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><small>Copyright <20> 2007 John Maddock</small></td>
<td align="right"><div class="copyright-footer"><small>Copyright <20> 2007 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p></small></div></td>
</tr></table>
<hr>
<div class="spirit-nav">

File diff suppressed because it is too large Load Diff