Fix typos reported by Sebastian Pipping.

[SVN r42025]
This commit is contained in:
John Maddock
2007-12-14 10:11:21 +00:00
parent 31668ed4be
commit 71fdd5eb44
86 changed files with 3114 additions and 3578 deletions

View File

@ -1,13 +1,13 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title> match_results</title>
<title>match_results</title>
<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
<link rel="start" href="../../index.html" title="Boost.Regex">
<link rel="up" href="../ref.html" title=" Reference">
<link rel="prev" href="basic_regex.html" title=" basic_regex">
<link rel="next" href="sub_match.html" title=" sub_match">
<link rel="up" href="../ref.html" title="Reference">
<link rel="prev" href="basic_regex.html" title="basic_regex">
<link rel="next" href="sub_match.html" title="sub_match">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@ -24,45 +24,44 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.ref.match_results"></a><a href="match_results.html" title=" match_results"> match_results</a></h3></div></div></div>
<a name="boost_regex.ref.match_results.synopsis"></a><h4>
<a name="id498310"></a>
<a name="boost_regex.ref.match_results"></a><a href="match_results.html" title="match_results"> match_results</a>
</h3></div></div></div>
<a name="boost_regex.ref.match_results.synopsis"></a><h5>
<a name="id531798"></a>
<a href="match_results.html#boost_regex.ref.match_results.synopsis">Synopsis</a>
</h4>
<pre class="programlisting">
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">regex</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
</h5>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">regex</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
</pre>
<p>
Regular expressions are different from many simple pattern-matching algorithms
in that as well as finding an overall match they can also produce sub-expression
matches: each sub-expression being delimited in the pattern by a pair of
parenthesis (...). There has to be some method for reporting sub-expression
matches back to the user: this is achieved this by defining a class <tt class="computeroutput"><span class="identifier">match_results</span></tt> that acts as an indexed collection
matches back to the user: this is achieved this by defining a class <code class="computeroutput"><span class="identifier">match_results</span></code> that acts as an indexed collection
of sub-expression matches, each sub-expression match being contained in an
object of type <a href="sub_match.html" title=" sub_match"><tt class="computeroutput"><span class="identifier">sub_match</span></tt></a>.
object of type <a href="sub_match.html" title="sub_match"><code class="computeroutput"><span class="identifier">sub_match</span></code></a>.
</p>
<p>
Template class <tt class="computeroutput"><span class="identifier">match_results</span></tt>
Template class <code class="computeroutput"><span class="identifier">match_results</span></code>
denotes a collection of character sequences representing the result of a
regular expression match. Objects of type <tt class="computeroutput"><span class="identifier">match_results</span></tt>
are passed to the algorithms <a href="regex_match.html" title=" regex_match"><tt class="computeroutput"><span class="identifier">regex_match</span></tt></a> and <a href="regex_search.html" title=" regex_search"><tt class="computeroutput"><span class="identifier">regex_search</span></tt></a>, and are returned by
the iterator <a href="regex_iterator.html" title=" regex_iterator"><tt class="computeroutput"><span class="identifier">regex_iterator</span></tt></a>. Storage for the
regular expression match. Objects of type <code class="computeroutput"><span class="identifier">match_results</span></code>
are passed to the algorithms <a href="regex_match.html" title="regex_match"><code class="computeroutput"><span class="identifier">regex_match</span></code></a> and <a href="regex_search.html" title="regex_search"><code class="computeroutput"><span class="identifier">regex_search</span></code></a>, and are returned by
the iterator <a href="regex_iterator.html" title="regex_iterator"><code class="computeroutput"><span class="identifier">regex_iterator</span></code></a>. Storage for the
collection is allocated and freed as necessary by the member functions of
class <tt class="computeroutput"><span class="identifier">match_results</span></tt>.
class <code class="computeroutput"><span class="identifier">match_results</span></code>.
</p>
<p>
The template class <tt class="computeroutput"><span class="identifier">match_results</span></tt>
The template class <code class="computeroutput"><span class="identifier">match_results</span></code>
conforms to the requirements of a Sequence, as specified in (lib.sequence.reqmts),
except that only operations defined for const-qualified Sequences are supported.
</p>
<p>
Class template <tt class="computeroutput"><span class="identifier">match_results</span></tt>
is most commonly used as one of the typedefs <tt class="computeroutput"><span class="identifier">cmatch</span></tt>,
<tt class="computeroutput"><span class="identifier">wcmatch</span></tt>, <tt class="computeroutput"><span class="identifier">smatch</span></tt>,
or <tt class="computeroutput"><span class="identifier">wsmatch</span></tt>:
Class template <code class="computeroutput"><span class="identifier">match_results</span></code>
is most commonly used as one of the typedefs <code class="computeroutput"><span class="identifier">cmatch</span></code>,
<code class="computeroutput"><span class="identifier">wcmatch</span></code>, <code class="computeroutput"><span class="identifier">smatch</span></code>,
or <code class="computeroutput"><span class="identifier">wsmatch</span></code>:
</p>
<pre class="programlisting">
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">BidirectionalIterator</span><span class="special">,</span>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">BidirectionalIterator</span><span class="special">,</span>
<span class="keyword">class</span> <span class="identifier">Allocator</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">allocator</span><span class="special">&lt;</span><span class="identifier">sub_match</span><span class="special">&lt;</span><span class="identifier">BidirectionalIterator</span><span class="special">&gt;</span> <span class="special">&gt;</span>
<span class="keyword">class</span> <span class="identifier">match_results</span><span class="special">;</span>
@ -142,23 +141,22 @@
<span class="keyword">void</span> <a href="match_results.html#boost_regex.match_results.op_swap">swap</a><span class="special">(</span><span class="identifier">match_results</span><span class="special">&lt;</span><span class="identifier">BidirectionalIterator</span><span class="special">,</span> <span class="identifier">Allocator</span><span class="special">&gt;&amp;</span> <span class="identifier">m1</span><span class="special">,</span>
<span class="identifier">match_results</span><span class="special">&lt;</span><span class="identifier">BidirectionalIterator</span><span class="special">,</span> <span class="identifier">Allocator</span><span class="special">&gt;&amp;</span> <span class="identifier">m2</span><span class="special">);</span>
</pre>
<a name="boost_regex.ref.match_results.description"></a><h4>
<a name="id501232"></a>
<a name="boost_regex.ref.match_results.description"></a><h5>
<a name="id534701"></a>
<a href="match_results.html#boost_regex.ref.match_results.description">Description</a>
</h4>
</h5>
<p>
In all <tt class="computeroutput"><span class="identifier">match_results</span></tt> constructors,
In all <code class="computeroutput"><span class="identifier">match_results</span></code> constructors,
a copy of the Allocator argument is used for any memory allocation performed
by the constructor or member functions during the lifetime of the object.
</p>
<a name="boost_regex.match_results.construct"></a><p>
</p>
<pre class="programlisting">
<span class="identifier">match_results</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Allocator</span><span class="special">&amp;</span> <span class="identifier">a</span> <span class="special">=</span> <span class="identifier">Allocator</span><span class="special">());</span>
<pre class="programlisting"><span class="identifier">match_results</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Allocator</span><span class="special">&amp;</span> <span class="identifier">a</span> <span class="special">=</span> <span class="identifier">Allocator</span><span class="special">());</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: Constructs an object of class
<tt class="computeroutput"><span class="identifier">match_results</span></tt>. The postconditions
<span class="bold"><strong>Effects</strong></span>: Constructs an object of class
<code class="computeroutput"><span class="identifier">match_results</span></code>. The postconditions
of this function are indicated in the table:
</p>
<div class="informaltable"><table class="table">
@ -219,20 +217,18 @@
</table></div>
<a name="boost_regex.match_results.copy_construct"></a><p>
</p>
<pre class="programlisting">
<span class="identifier">match_results</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">match_results</span><span class="special">&amp;</span> <span class="identifier">m</span><span class="special">);</span>
<pre class="programlisting"><span class="identifier">match_results</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">match_results</span><span class="special">&amp;</span> <span class="identifier">m</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: Constructs an object of class match_results,
<span class="bold"><strong>Effects</strong></span>: Constructs an object of class match_results,
as a copy of m.
</p>
<a name="boost_regex.match_results.assign"></a><p>
</p>
<pre class="programlisting">
<span class="identifier">match_results</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span><span class="keyword">const</span> <span class="identifier">match_results</span><span class="special">&amp;</span> <span class="identifier">m</span><span class="special">);</span>
<pre class="programlisting"><span class="identifier">match_results</span><span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span><span class="keyword">const</span> <span class="identifier">match_results</span><span class="special">&amp;</span> <span class="identifier">m</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: Assigns m to *this. The postconditions
<span class="bold"><strong>Effects</strong></span>: Assigns m to *this. The postconditions
of this function are indicated in the table:
</p>
<div class="informaltable"><table class="table">
@ -353,218 +349,201 @@
</table></div>
<a name="boost_regex.match_results.size"></a><p>
</p>
<pre class="programlisting">
<span class="identifier">size_type</span> <span class="identifier">size</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
<pre class="programlisting"><span class="identifier">size_type</span> <span class="identifier">size</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: Returns the number of <a href="sub_match.html" title=" sub_match"><tt class="computeroutput"><span class="identifier">sub_match</span></tt></a> elements stored in *this;
<span class="bold"><strong>Effects</strong></span>: Returns the number of <a href="sub_match.html" title="sub_match"><code class="computeroutput"><span class="identifier">sub_match</span></code></a> elements stored in *this;
that is the number of marked sub-expressions in the regular expression that
was matched plus one.
</p>
<a name="boost_regex.match_results.max_size"></a><p>
</p>
<pre class="programlisting">
<span class="identifier">size_type</span> <span class="identifier">max_size</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
<pre class="programlisting"><span class="identifier">size_type</span> <span class="identifier">max_size</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: Returns the maximum number of
<a href="sub_match.html" title=" sub_match"><tt class="computeroutput"><span class="identifier">sub_match</span></tt></a>
<span class="bold"><strong>Effects</strong></span>: Returns the maximum number of
<a href="sub_match.html" title="sub_match"><code class="computeroutput"><span class="identifier">sub_match</span></code></a>
elements that can be stored in *this.
</p>
<a name="boost_regex.match_results.empty"></a><p>
</p>
<pre class="programlisting">
<span class="keyword">bool</span> <span class="identifier">empty</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">empty</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: Returns size() == 0.
<span class="bold"><strong>Effects</strong></span>: Returns size() == 0.
</p>
<a name="boost_regex.match_results.length"></a><p>
</p>
<pre class="programlisting">
<span class="identifier">difference_type</span> <span class="identifier">length</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">sub</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="keyword">const</span><span class="special">;</span>
<pre class="programlisting"><span class="identifier">difference_type</span> <span class="identifier">length</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">sub</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: Returns the length of sub-expression
<span class="emphasis"><em>sub</em></span>, that is to say: <tt class="computeroutput"><span class="special">(*</span><span class="keyword">this</span><span class="special">)[</span><span class="identifier">sub</span><span class="special">].</span><span class="identifier">length</span><span class="special">()</span></tt>.
<span class="bold"><strong>Effects</strong></span>: Returns the length of sub-expression
<span class="emphasis"><em>sub</em></span>, that is to say: <code class="computeroutput"><span class="special">(*</span><span class="keyword">this</span><span class="special">)[</span><span class="identifier">sub</span><span class="special">].</span><span class="identifier">length</span><span class="special">()</span></code>.
</p>
<a name="boost_regex.match_results.position"></a><p>
</p>
<pre class="programlisting">
<span class="identifier">difference_type</span> <span class="identifier">position</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="keyword">int</span> <span class="identifier">sub</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="keyword">const</span><span class="special">;</span>
<pre class="programlisting"><span class="identifier">difference_type</span> <span class="identifier">position</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="keyword">int</span> <span class="identifier">sub</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: Returns the starting location of
<span class="bold"><strong>Effects</strong></span>: Returns the starting location of
sub-expression <span class="emphasis"><em>sub</em></span>, or -1 if <span class="emphasis"><em>sub</em></span>
was not matched. Note that if this represents a partial match , then <tt class="computeroutput"><span class="identifier">position</span><span class="special">()</span></tt>
will return the location of the partial match even though <tt class="computeroutput"><span class="special">(*</span><span class="keyword">this</span><span class="special">)[</span><span class="number">0</span><span class="special">].</span><span class="identifier">matched</span></tt>
was not matched. Note that if this represents a partial match , then <code class="computeroutput"><span class="identifier">position</span><span class="special">()</span></code>
will return the location of the partial match even though <code class="computeroutput"><span class="special">(*</span><span class="keyword">this</span><span class="special">)[</span><span class="number">0</span><span class="special">].</span><span class="identifier">matched</span></code>
is false.
</p>
<a name="boost_regex.match_results.str"></a><p>
</p>
<pre class="programlisting">
<span class="identifier">string_type</span> <span class="identifier">str</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">sub</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="keyword">const</span><span class="special">;</span>
<pre class="programlisting"><span class="identifier">string_type</span> <span class="identifier">str</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">sub</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: Returns sub-expression <span class="emphasis"><em>sub</em></span>
as a string: <tt class="computeroutput"><span class="identifier">string_type</span><span class="special">((*</span><span class="keyword">this</span><span class="special">)[</span><span class="identifier">sub</span><span class="special">])</span></tt>.
<span class="bold"><strong>Effects</strong></span>: Returns sub-expression <span class="emphasis"><em>sub</em></span>
as a string: <code class="computeroutput"><span class="identifier">string_type</span><span class="special">((*</span><span class="keyword">this</span><span class="special">)[</span><span class="identifier">sub</span><span class="special">])</span></code>.
</p>
<a name="boost_regex.match_results.subscript"></a><p>
</p>
<pre class="programlisting">
<span class="identifier">const_reference</span> <span class="keyword">operator</span><span class="special">[](</span><span class="keyword">int</span> <span class="identifier">n</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
<pre class="programlisting"><span class="identifier">const_reference</span> <span class="keyword">operator</span><span class="special">[](</span><span class="keyword">int</span> <span class="identifier">n</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: Returns a reference to the <a href="sub_match.html" title=" sub_match"><tt class="computeroutput"><span class="identifier">sub_match</span></tt></a>
<span class="bold"><strong>Effects</strong></span>: Returns a reference to the <a href="sub_match.html" title="sub_match"><code class="computeroutput"><span class="identifier">sub_match</span></code></a>
object representing the character sequence that matched marked sub-expression
<span class="emphasis"><em>n</em></span>. If <tt class="computeroutput"><span class="identifier">n</span> <span class="special">==</span> <span class="number">0</span></tt> then returns
a reference to a <a href="sub_match.html" title=" sub_match"><tt class="computeroutput"><span class="identifier">sub_match</span></tt></a> object representing the
<span class="emphasis"><em>n</em></span>. If <code class="computeroutput"><span class="identifier">n</span> <span class="special">==</span> <span class="number">0</span></code> then returns
a reference to a <a href="sub_match.html" title="sub_match"><code class="computeroutput"><span class="identifier">sub_match</span></code></a> object representing the
character sequence that matched the whole regular expression. If <span class="emphasis"><em>n</em></span>
is out of range, or if <span class="emphasis"><em>n</em></span> is an unmatched sub-expression,
then returns a <a href="sub_match.html" title=" sub_match"><tt class="computeroutput"><span class="identifier">sub_match</span></tt></a>
then returns a <a href="sub_match.html" title="sub_match"><code class="computeroutput"><span class="identifier">sub_match</span></code></a>
object whose matched member is false.
</p>
<a name="boost_regex.match_results.prefix"></a><p>
</p>
<pre class="programlisting">
<span class="identifier">const_reference</span> <span class="identifier">prefix</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
<pre class="programlisting"><span class="identifier">const_reference</span> <span class="identifier">prefix</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: Returns a reference to the <a href="sub_match.html" title=" sub_match"><tt class="computeroutput"><span class="identifier">sub_match</span></tt></a>
<span class="bold"><strong>Effects</strong></span>: Returns a reference to the <a href="sub_match.html" title="sub_match"><code class="computeroutput"><span class="identifier">sub_match</span></code></a>
object representing the character sequence from the start of the string being
matched or searched, to the start of the match found.
</p>
<a name="boost_regex.match_results.suffix"></a><p>
</p>
<pre class="programlisting">
<span class="identifier">const_reference</span> <span class="identifier">suffix</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
<pre class="programlisting"><span class="identifier">const_reference</span> <span class="identifier">suffix</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: Returns a reference to the <a href="sub_match.html" title=" sub_match"><tt class="computeroutput"><span class="identifier">sub_match</span></tt></a>
<span class="bold"><strong>Effects</strong></span>: Returns a reference to the <a href="sub_match.html" title="sub_match"><code class="computeroutput"><span class="identifier">sub_match</span></code></a>
object representing the character sequence from the end of the match found
to the end of the string being matched or searched.
</p>
<a name="boost_regex.match_results.begin"></a><p>
</p>
<pre class="programlisting">
<span class="identifier">const_iterator</span> <span class="identifier">begin</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
<pre class="programlisting"><span class="identifier">const_iterator</span> <span class="identifier">begin</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: Returns a starting iterator that
<span class="bold"><strong>Effects</strong></span>: Returns a starting iterator that
enumerates over all the marked sub-expression matches stored in *this.
</p>
<a name="boost_regex.match_results.end"></a><p>
</p>
<pre class="programlisting">
<span class="identifier">const_iterator</span> <span class="identifier">end</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
<pre class="programlisting"><span class="identifier">const_iterator</span> <span class="identifier">end</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: Returns a terminating iterator
<span class="bold"><strong>Effects</strong></span>: Returns a terminating iterator
that enumerates over all the marked sub-expression matches stored in *this.
</p>
<a name="boost_regex.match_results_format"></a><a name="boost_regex.match_results.format"></a><p>
</p>
<pre class="programlisting">
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">OutputIterator</span><span class="special">&gt;</span>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">OutputIterator</span><span class="special">&gt;</span>
<span class="identifier">OutputIterator</span> <span class="identifier">format</span><span class="special">(</span><span class="identifier">OutputIterator</span> <span class="identifier">out</span><span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">&amp;</span> <span class="identifier">fmt</span><span class="special">,</span>
<span class="identifier">match_flag_type</span> <span class="identifier">flags</span> <span class="special">=</span> <span class="identifier">format_default</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><b>Requires</b></span>: The type <tt class="computeroutput"><span class="identifier">OutputIterator</span></tt>
<span class="bold"><strong>Requires</strong></span>: The type <code class="computeroutput"><span class="identifier">OutputIterator</span></code>
conforms to the Output Iterator requirements (C++ std 24.1.2).
</p>
<p>
<span class="bold"><b>Effects</b></span>: Copies the character sequence
<tt class="computeroutput"><span class="special">[</span><span class="identifier">fmt</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">fmt</span><span class="special">.</span><span class="identifier">end</span><span class="special">())</span></tt>
to <tt class="computeroutput"><span class="identifier">OutputIterator</span></tt> <span class="emphasis"><em>out</em></span>.
<span class="bold"><strong>Effects</strong></span>: Copies the character sequence
<code class="computeroutput"><span class="special">[</span><span class="identifier">fmt</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">fmt</span><span class="special">.</span><span class="identifier">end</span><span class="special">())</span></code>
to <code class="computeroutput"><span class="identifier">OutputIterator</span></code> <span class="emphasis"><em>out</em></span>.
For each format specifier or escape sequence in <span class="emphasis"><em>fmt</em></span>,
replace that sequence with either the character(s) it represents, or the
sequence of characters within <tt class="computeroutput"><span class="special">*</span><span class="keyword">this</span></tt> to which it refers. The bitmasks specified
sequence of characters within <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code> to which it refers. The bitmasks specified
in flags determines what format specifiers or escape sequences are recognized,
by default this is the format used by ECMA-262, ECMAScript Language Specification,
Chapter 15 part 5.4.11 String.prototype.replace.
</p>
<p>
See the <a href="../format.html" title=" Search and Replace Format String Syntax">format syntax guide for more information</a>.
See the <a href="../format.html" title="Search and Replace Format String Syntax">format syntax guide for more information</a>.
</p>
<p>
<span class="bold"><b>Returns</b></span>: out.
<span class="bold"><strong>Returns</strong></span>: out.
</p>
<a name="boost_regex.match_results.format2"></a><p>
</p>
<pre class="programlisting">
<span class="identifier">string_type</span> <span class="identifier">format</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">&amp;</span> <span class="identifier">fmt</span><span class="special">,</span>
<pre class="programlisting"><span class="identifier">string_type</span> <span class="identifier">format</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">&amp;</span> <span class="identifier">fmt</span><span class="special">,</span>
<span class="identifier">match_flag_type</span> <span class="identifier">flags</span> <span class="special">=</span> <span class="identifier">format_default</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: Returns a copy of the string <span class="emphasis"><em>fmt</em></span>.
<span class="bold"><strong>Effects</strong></span>: Returns a copy of the string <span class="emphasis"><em>fmt</em></span>.
For each format specifier or escape sequence in <span class="emphasis"><em>fmt</em></span>,
replace that sequence with either the character(s) it represents, or the
sequence of characters within <tt class="computeroutput"><span class="special">*</span><span class="keyword">this</span></tt> to which it refers. The bitmasks specified
sequence of characters within <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code> to which it refers. The bitmasks specified
in flags determines what format specifiers or escape sequences are recognized,
by default this is the format used by ECMA-262, ECMAScript Language Specification,
Chapter 15 part 5.4.11 String.prototype.replace.
</p>
<p>
See the <a href="../format.html" title=" Search and Replace Format String Syntax">format syntax guide for more information</a>.
See the <a href="../format.html" title="Search and Replace Format String Syntax">format syntax guide for more information</a>.
</p>
<a name="boost_regex.match_results.get_allocator"></a><p>
</p>
<pre class="programlisting">
<span class="identifier">allocator_type</span> <span class="identifier">get_allocator</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
<pre class="programlisting"><span class="identifier">allocator_type</span> <span class="identifier">get_allocator</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: Returns a copy of the Allocator
<span class="bold"><strong>Effects</strong></span>: Returns a copy of the Allocator
that was passed to the object's constructor.
</p>
<a name="boost_regex.match_results.swap"></a><p>
</p>
<pre class="programlisting">
<span class="keyword">void</span> <span class="identifier">swap</span><span class="special">(</span><span class="identifier">match_results</span><span class="special">&amp;</span> <span class="identifier">that</span><span class="special">);</span>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">swap</span><span class="special">(</span><span class="identifier">match_results</span><span class="special">&amp;</span> <span class="identifier">that</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: Swaps the contents of the two sequences.
<span class="bold"><strong>Effects</strong></span>: Swaps the contents of the two sequences.
</p>
<p>
<span class="bold"><b>Postcondition</b></span>: *this contains the sequence
<span class="bold"><strong>Postcondition</strong></span>: *this contains the sequence
of matched sub-expressions that were in that, that contains the sequence
of matched sub-expressions that were in *this.
</p>
<p>
<span class="bold"><b>Complexity</b></span>: constant time.
<span class="bold"><strong>Complexity</strong></span>: constant time.
</p>
<a name="boost_regex.match_results.capture_type"></a><p>
</p>
<pre class="programlisting">
<span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">value_type</span><span class="special">::</span><span class="identifier">capture_sequence_type</span> <span class="identifier">capture_sequence_type</span><span class="special">;</span>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">value_type</span><span class="special">::</span><span class="identifier">capture_sequence_type</span> <span class="identifier">capture_sequence_type</span><span class="special">;</span>
</pre>
<p>
Defines an implementation-specific type that satisfies the requirements of
a standard library Sequence (21.1.1 including the optional Table 68 operations),
whose value_type is a <tt class="computeroutput"><span class="identifier">sub_match</span><span class="special">&lt;</span><span class="identifier">BidirectionalIterator</span><span class="special">&gt;</span></tt>. This type happens to be <tt class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">sub_match</span><span class="special">&lt;</span><span class="identifier">BidirectionalIterator</span><span class="special">&gt;</span> <span class="special">&gt;</span></tt>,
whose value_type is a <code class="computeroutput"><span class="identifier">sub_match</span><span class="special">&lt;</span><span class="identifier">BidirectionalIterator</span><span class="special">&gt;</span></code>. This type happens to be <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">sub_match</span><span class="special">&lt;</span><span class="identifier">BidirectionalIterator</span><span class="special">&gt;</span> <span class="special">&gt;</span></code>,
but you shouldn't actually rely on that.
</p>
<a name="boost_regex.match_results.captures"></a><p>
</p>
<pre class="programlisting">
<span class="keyword">const</span> <span class="identifier">capture_sequence_type</span><span class="special">&amp;</span> <span class="identifier">captures</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">i</span><span class="special">)</span><span class="keyword">const</span><span class="special">;</span>
<pre class="programlisting"><span class="keyword">const</span> <span class="identifier">capture_sequence_type</span><span class="special">&amp;</span> <span class="identifier">captures</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">i</span><span class="special">)</span><span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: returns a sequence containing all
<span class="bold"><strong>Effects</strong></span>: returns a sequence containing all
the captures obtained for sub-expression i.
</p>
<p>
<span class="bold"><b>Returns</b></span>: <tt class="computeroutput"><span class="special">(*</span><span class="keyword">this</span><span class="special">)[</span><span class="identifier">i</span><span class="special">].</span><span class="identifier">captures</span><span class="special">();</span></tt>
<span class="bold"><strong>Returns</strong></span>: <code class="computeroutput"><span class="special">(*</span><span class="keyword">this</span><span class="special">)[</span><span class="identifier">i</span><span class="special">].</span><span class="identifier">captures</span><span class="special">();</span></code>
</p>
<p>
<span class="bold"><b>Preconditions</b></span>: the library must be built
<span class="bold"><strong>Preconditions</strong></span>: the library must be built
and used with BOOST_REGEX_MATCH_EXTRA defined, and you must pass the flag
match_extra to the regex matching functions ( <a href="regex_match.html" title=" regex_match"><tt class="computeroutput"><span class="identifier">regex_match</span></tt></a>, <a href="regex_search.html" title=" regex_search"><tt class="computeroutput"><span class="identifier">regex_search</span></tt></a>, <a href="regex_iterator.html" title=" regex_iterator"><tt class="computeroutput"><span class="identifier">regex_iterator</span></tt></a> or <a href="regex_token_iterator.html" title=" regex_token_iterator"><tt class="computeroutput"><span class="identifier">regex_token_iterator</span></tt></a>) in order for
match_extra to the regex matching functions ( <a href="regex_match.html" title="regex_match"><code class="computeroutput"><span class="identifier">regex_match</span></code></a>, <a href="regex_search.html" title="regex_search"><code class="computeroutput"><span class="identifier">regex_search</span></code></a>, <a href="regex_iterator.html" title="regex_iterator"><code class="computeroutput"><span class="identifier">regex_iterator</span></code></a> or <a href="regex_token_iterator.html" title="regex_token_iterator"><code class="computeroutput"><span class="identifier">regex_token_iterator</span></code></a>) in order for
this member function to be defined and return useful information.
</p>
<p>
<span class="bold"><b>Rationale</b></span>: Enabling this feature has several
<span class="bold"><strong>Rationale</strong></span>: Enabling this feature has several
consequences:
</p>
<div class="itemizedlist"><ul type="disc">
@ -584,57 +563,54 @@
</ul></div>
<a name="boost_regex.match_results.op_eq"></a><p>
</p>
<pre class="programlisting">
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">BidirectionalIterator</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Allocator</span><span class="special">&gt;</span>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">BidirectionalIterator</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Allocator</span><span class="special">&gt;</span>
<span class="keyword">bool</span> <span class="keyword">operator</span> <span class="special">==</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">match_results</span><span class="special">&lt;</span><span class="identifier">BidirectionalIterator</span><span class="special">,</span> <span class="identifier">Allocator</span><span class="special">&gt;&amp;</span> <span class="identifier">m1</span><span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">match_results</span><span class="special">&lt;</span><span class="identifier">BidirectionalIterator</span><span class="special">,</span> <span class="identifier">Allocator</span><span class="special">&gt;&amp;</span> <span class="identifier">m2</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: Compares the two sequences for
<span class="bold"><strong>Effects</strong></span>: Compares the two sequences for
equality.
</p>
<a name="boost_regex.match_results.op_ne"></a><p>
</p>
<pre class="programlisting">
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">BidirectionalIterator</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Allocator</span><span class="special">&gt;</span>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">BidirectionalIterator</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Allocator</span><span class="special">&gt;</span>
<span class="keyword">bool</span> <span class="keyword">operator</span> <span class="special">!=</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">match_results</span><span class="special">&lt;</span><span class="identifier">BidirectionalIterator</span><span class="special">,</span> <span class="identifier">Allocator</span><span class="special">&gt;&amp;</span> <span class="identifier">m1</span><span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">match_results</span><span class="special">&lt;</span><span class="identifier">BidirectionalIterator</span><span class="special">,</span> <span class="identifier">Allocator</span><span class="special">&gt;&amp;</span> <span class="identifier">m2</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: Compares the two sequences for
<span class="bold"><strong>Effects</strong></span>: Compares the two sequences for
inequality.
</p>
<a name="boost_regex.match_results.op_stream"></a><p>
</p>
<pre class="programlisting">
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">charT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">traits</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">BidirectionalIterator</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Allocator</span><span class="special">&gt;</span>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">charT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">traits</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">BidirectionalIterator</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Allocator</span><span class="special">&gt;</span>
<span class="identifier">basic_ostream</span><span class="special">&lt;</span><span class="identifier">charT</span><span class="special">,</span> <span class="identifier">traits</span><span class="special">&gt;&amp;</span>
<span class="keyword">operator</span> <span class="special">&lt;&lt;</span> <span class="special">(</span><span class="identifier">basic_ostream</span><span class="special">&lt;</span><span class="identifier">charT</span><span class="special">,</span> <span class="identifier">traits</span><span class="special">&gt;&amp;</span> <span class="identifier">os</span><span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">match_results</span><span class="special">&lt;</span><span class="identifier">BidirectionalIterator</span><span class="special">,</span> <span class="identifier">Allocator</span><span class="special">&gt;&amp;</span> <span class="identifier">m</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: Writes the contents of <span class="emphasis"><em>m</em></span>
to the stream <span class="emphasis"><em>os</em></span> as if by calling <tt class="computeroutput"><span class="identifier">os</span>
<span class="special">&lt;&lt;</span> <span class="identifier">m</span><span class="special">.</span><span class="identifier">str</span><span class="special">()</span></tt>;
<span class="bold"><strong>Effects</strong></span>: Writes the contents of <span class="emphasis"><em>m</em></span>
to the stream <span class="emphasis"><em>os</em></span> as if by calling <code class="computeroutput"><span class="identifier">os</span>
<span class="special">&lt;&lt;</span> <span class="identifier">m</span><span class="special">.</span><span class="identifier">str</span><span class="special">()</span></code>;
Returns <span class="emphasis"><em>os</em></span>.
</p>
<a name="boost_regex.match_results.op_swap"></a><p>
</p>
<pre class="programlisting">
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">BidirectionalIterator</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Allocator</span><span class="special">&gt;</span>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">BidirectionalIterator</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Allocator</span><span class="special">&gt;</span>
<span class="keyword">void</span> <span class="identifier">swap</span><span class="special">(</span><span class="identifier">match_results</span><span class="special">&lt;</span><span class="identifier">BidirectionalIterator</span><span class="special">,</span> <span class="identifier">Allocator</span><span class="special">&gt;&amp;</span> <span class="identifier">m1</span><span class="special">,</span>
<span class="identifier">match_results</span><span class="special">&lt;</span><span class="identifier">BidirectionalIterator</span><span class="special">,</span> <span class="identifier">Allocator</span><span class="special">&gt;&amp;</span> <span class="identifier">m2</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><b>Effects</b></span>: Swaps the contents of the two sequences.
<span class="bold"><strong>Effects</strong></span>: Swaps the contents of the two sequences.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer"><small>Copyright <20> 2007 John Maddock<p>
<td align="right"><div class="copyright-footer">Copyright <20> 1998 -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>
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">