Imported Upstream version 1.51.0
[platform/upstream/boost.git] / doc / html / boost / xpressive / regex_iterator.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Struct template regex_iterator</title>
5 <link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
8 <link rel="up" href="../../xpressive/reference.html#header.boost.xpressive.regex_iterator_hpp" title="Header &lt;boost/xpressive/regex_iterator.hpp&gt;">
9 <link rel="prev" href="../../BOOST_XPR_ENSURE_.html" title="Macro BOOST_XPR_ENSURE_">
10 <link rel="next" href="mark_tag.html" title="Struct mark_tag">
11 </head>
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
15 <td align="center"><a href="../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../more/index.htm">More</a></td>
20 </tr></table>
21 <hr>
22 <div class="spirit-nav">
23 <a accesskey="p" href="../../BOOST_XPR_ENSURE_.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../xpressive/reference.html#header.boost.xpressive.regex_iterator_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="mark_tag.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
24 </div>
25 <div class="refentry">
26 <a name="boost.xpressive.regex_iterator"></a><div class="titlepage"></div>
27 <div class="refnamediv">
28 <h2><span class="refentrytitle">Struct template regex_iterator</span></h2>
29 <p>boost::xpressive::regex_iterator</p>
30 </div>
31 <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
32 <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../xpressive/reference.html#header.boost.xpressive.regex_iterator_hpp" title="Header &lt;boost/xpressive/regex_iterator.hpp&gt;">boost/xpressive/regex_iterator.hpp</a>&gt;
33
34 </span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> BidiIter<span class="special">&gt;</span> 
35 <span class="keyword">struct</span> <a class="link" href="regex_iterator.html" title="Struct template regex_iterator">regex_iterator</a> <span class="special">{</span>
36   <span class="comment">// types</span>
37   <span class="keyword">typedef</span> <a class="link" href="basic_regex.html" title="Struct template basic_regex">basic_regex</a><span class="special">&lt;</span> <span class="identifier">BidiIter</span> <span class="special">&gt;</span>               <a name="boost.xpressive.regex_iterator.regex_type"></a><span class="identifier">regex_type</span><span class="special">;</span>       
38   <span class="keyword">typedef</span> <a class="link" href="match_results.html" title="Struct template match_results">match_results</a><span class="special">&lt;</span> <span class="identifier">BidiIter</span> <span class="special">&gt;</span>             <a name="boost.xpressive.regex_iterator.value_type"></a><span class="identifier">value_type</span><span class="special">;</span>       
39   <span class="keyword">typedef</span> <span class="identifier">iterator_difference</span><span class="special">&lt;</span> <span class="identifier">BidiIter</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span> <a name="boost.xpressive.regex_iterator.difference_type"></a><span class="identifier">difference_type</span><span class="special">;</span>  
40   <span class="keyword">typedef</span> <a class="link" href="regex_iterator.html#boost.xpressive.regex_iterator.value_type">value_type</a> <span class="keyword">const</span> <span class="special">*</span>                    <a name="boost.xpressive.regex_iterator.pointer"></a><span class="identifier">pointer</span><span class="special">;</span>          
41   <span class="keyword">typedef</span> <a class="link" href="regex_iterator.html#boost.xpressive.regex_iterator.value_type">value_type</a> <span class="keyword">const</span> <span class="special">&amp;</span>                    <a name="boost.xpressive.regex_iterator.reference"></a><span class="identifier">reference</span><span class="special">;</span>        
42   <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">forward_iterator_tag</span>             <a name="boost.xpressive.regex_iterator.iterator_category"></a><span class="identifier">iterator_category</span><span class="special">;</span>
43
44   <span class="comment">// <a class="link" href="regex_iterator.html#boost.xpressive.regex_iteratorconstruct-copy-destruct">construct/copy/destruct</a></span>
45   <a class="link" href="regex_iterator.html#id1896764-bb"><span class="identifier">regex_iterator</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
46   <a class="link" href="regex_iterator.html#id1896765-bb"><span class="identifier">regex_iterator</span></a><span class="special">(</span><span class="identifier">BidiIter</span><span class="special">,</span> <span class="identifier">BidiIter</span><span class="special">,</span> <a class="link" href="basic_regex.html" title="Struct template basic_regex">basic_regex</a><span class="special">&lt;</span> <span class="identifier">BidiIter</span> <span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> 
47                  <span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">match_flag_type</span> <span class="special">=</span> <span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">match_default</span><span class="special">)</span><span class="special">;</span>
48   <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> LetExpr<span class="special">&gt;</span> 
49     <a class="link" href="regex_iterator.html#id1896794-bb"><span class="identifier">regex_iterator</span></a><span class="special">(</span><span class="identifier">BidiIter</span><span class="special">,</span> <span class="identifier">BidiIter</span><span class="special">,</span> <a class="link" href="basic_regex.html" title="Struct template basic_regex">basic_regex</a><span class="special">&lt;</span> <span class="identifier">BidiIter</span> <span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> 
50                    <span class="emphasis"><em><span class="identifier">unspecified</span></em></span><span class="special">,</span> 
51                    <span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">match_flag_type</span> <span class="special">=</span> <span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">match_default</span><span class="special">)</span><span class="special">;</span>
52   <a class="link" href="regex_iterator.html#id1896837-bb"><span class="identifier">regex_iterator</span></a><span class="special">(</span><a class="link" href="regex_iterator.html" title="Struct template regex_iterator">regex_iterator</a><span class="special">&lt;</span> <span class="identifier">BidiIter</span> <span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
53   regex_iterator&amp; <a class="link" href="regex_iterator.html#id1896846-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><a class="link" href="regex_iterator.html" title="Struct template regex_iterator">regex_iterator</a><span class="special">&lt;</span> <span class="identifier">BidiIter</span> <span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
54
55   <span class="comment">// <a class="link" href="regex_iterator.html#id1896653-bb">public member functions</a></span>
56   <a class="link" href="regex_iterator.html#boost.xpressive.regex_iterator.value_type">value_type</a> <span class="keyword">const</span> <span class="special">&amp;</span> <a class="link" href="regex_iterator.html#id1896657-bb"><span class="keyword">operator</span><span class="special">*</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
57   <a class="link" href="regex_iterator.html#boost.xpressive.regex_iterator.value_type">value_type</a> <span class="keyword">const</span> <span class="special">*</span> <a class="link" href="regex_iterator.html#id1896667-bb"><span class="keyword">operator</span><span class="special">-&gt;</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
58   <a class="link" href="regex_iterator.html" title="Struct template regex_iterator">regex_iterator</a><span class="special">&lt;</span> <span class="identifier">BidiIter</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <a class="link" href="regex_iterator.html#id1896677-bb"><span class="keyword">operator</span><span class="special">++</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
59   <a class="link" href="regex_iterator.html" title="Struct template regex_iterator">regex_iterator</a><span class="special">&lt;</span> <span class="identifier">BidiIter</span> <span class="special">&gt;</span> <a class="link" href="regex_iterator.html#id1896748-bb"><span class="keyword">operator</span><span class="special">++</span></a><span class="special">(</span><span class="keyword">int</span><span class="special">)</span><span class="special">;</span>
60 <span class="special">}</span><span class="special">;</span></pre></div>
61 <div class="refsect1">
62 <a name="id3910982"></a><h2>Description</h2>
63 <div class="refsect2">
64 <a name="id3910986"></a><h3>
65 <a name="boost.xpressive.regex_iteratorconstruct-copy-destruct"></a><code class="computeroutput">regex_iterator</code> 
66         public
67        construct/copy/destruct</h3>
68 <div class="orderedlist"><ol class="orderedlist" type="1">
69 <li class="listitem"><pre class="literallayout"><a name="id1896764-bb"></a><span class="identifier">regex_iterator</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li>
70 <li class="listitem"><pre class="literallayout"><a name="id1896765-bb"></a><span class="identifier">regex_iterator</span><span class="special">(</span><span class="identifier">BidiIter</span> begin<span class="special">,</span> <span class="identifier">BidiIter</span> end<span class="special">,</span> 
71                <a class="link" href="basic_regex.html" title="Struct template basic_regex">basic_regex</a><span class="special">&lt;</span> <span class="identifier">BidiIter</span> <span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> rex<span class="special">,</span> 
72                <span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">match_flag_type</span> flags <span class="special">=</span> <span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">match_default</span><span class="special">)</span><span class="special">;</span></pre></li>
73 <li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> LetExpr<span class="special">&gt;</span> 
74   <a name="id1896794-bb"></a><span class="identifier">regex_iterator</span><span class="special">(</span><span class="identifier">BidiIter</span> begin<span class="special">,</span> <span class="identifier">BidiIter</span> end<span class="special">,</span> 
75                  <a class="link" href="basic_regex.html" title="Struct template basic_regex">basic_regex</a><span class="special">&lt;</span> <span class="identifier">BidiIter</span> <span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> rex<span class="special">,</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> args<span class="special">,</span> 
76                  <span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">match_flag_type</span> flags <span class="special">=</span> <span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">match_default</span><span class="special">)</span><span class="special">;</span></pre></li>
77 <li class="listitem"><pre class="literallayout"><a name="id1896837-bb"></a><span class="identifier">regex_iterator</span><span class="special">(</span><a class="link" href="regex_iterator.html" title="Struct template regex_iterator">regex_iterator</a><span class="special">&lt;</span> <span class="identifier">BidiIter</span> <span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> that<span class="special">)</span><span class="special">;</span></pre></li>
78 <li class="listitem"><pre class="literallayout">regex_iterator&amp; <a name="id1896846-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><a class="link" href="regex_iterator.html" title="Struct template regex_iterator">regex_iterator</a><span class="special">&lt;</span> <span class="identifier">BidiIter</span> <span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> that<span class="special">)</span><span class="special">;</span></pre></li>
79 </ol></div>
80 </div>
81 <div class="refsect2">
82 <a name="id3911450"></a><h3>
83 <a name="id1896653-bb"></a><code class="computeroutput">regex_iterator</code> public member functions</h3>
84 <div class="orderedlist"><ol class="orderedlist" type="1">
85 <li class="listitem"><pre class="literallayout"><a class="link" href="regex_iterator.html#boost.xpressive.regex_iterator.value_type">value_type</a> <span class="keyword">const</span> <span class="special">&amp;</span> <a name="id1896657-bb"></a><span class="keyword">operator</span><span class="special">*</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
86 <li class="listitem"><pre class="literallayout"><a class="link" href="regex_iterator.html#boost.xpressive.regex_iterator.value_type">value_type</a> <span class="keyword">const</span> <span class="special">*</span> <a name="id1896667-bb"></a><span class="keyword">operator</span><span class="special">-&gt;</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
87 <li class="listitem">
88 <pre class="literallayout"><a class="link" href="regex_iterator.html" title="Struct template regex_iterator">regex_iterator</a><span class="special">&lt;</span> <span class="identifier">BidiIter</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <a name="id1896677-bb"></a><span class="keyword">operator</span><span class="special">++</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
89 <p>If what.prefix().first != what[0].second and if the element match_prev_avail is not set in flags then sets it. Then behaves as if by calling regex_search(what[0].second, end, what, *pre, flags), with the following variation: in the event that the previous match found was of zero length (what[0].length() == 0) then attempts to find a non-zero length match starting at what[0].second, only if that fails and provided what[0].second != suffix().second does it look for a (possibly zero length) match starting from what[0].second + 1. If no further match is found then sets this equal to the end of sequence iterator. 
90 </p>
91 <div class="variablelist"><table border="0">
92 <col align="left" valign="top">
93 <tbody><tr>
94 <td><p><span class="term">Postconditions:</span></p></td>
95 <td>
96 <p>(*this)-&gt;size() == pre-&gt;mark_count() + 1 </p>
97 <p>(*this)-&gt;empty() == false </p>
98 <p>(*this)-&gt;prefix().first == An iterator denoting the end point of the previous match found </p>
99 <p>(*this)-&gt;prefix().last == (**this)[0].first </p>
100 <p>(*this)-&gt;prefix().matched == (*this)-&gt;prefix().first != (*this)-&gt;prefix().second </p>
101 <p>(*this)-&gt;suffix().first == (**this)[0].second </p>
102 <p>(*this)-&gt;suffix().last == end </p>
103 <p>(*this)-&gt;suffix().matched == (*this)-&gt;suffix().first != (*this)-&gt;suffix().second </p>
104 <p>(**this)[0].first == The starting iterator for this match. </p>
105 <p>(**this)[0].second == The ending iterator for this match. </p>
106 <p>(**this)[0].matched == true if a full match was found, and false if it was a partial match (found as a result of the match_partial flag being set). </p>
107 <p>(**this)[n].first == For all integers n &lt; (*this)-&gt;size(), the start of the sequence that matched sub-expression n. Alternatively, if sub-expression n did not participate in the match, then end. </p>
108 <p>(**this)[n].second == For all integers n &lt; (*this)-&gt;size(), the end of the sequence that matched sub-expression n. Alternatively, if sub-expression n did not participate in the match, then end. </p>
109 <p>(**this)[n].matched == For all integers n &lt; (*this)-&gt;size(), true if sub-expression n participated in the match, false otherwise. </p>
110 <p>(*this)-&gt;position() == The distance from the start of the original sequence being iterated, to the start of this match. </p>
111 </td>
112 </tr></tbody>
113 </table></div>
114 </li>
115 <li class="listitem"><pre class="literallayout"><a class="link" href="regex_iterator.html" title="Struct template regex_iterator">regex_iterator</a><span class="special">&lt;</span> <span class="identifier">BidiIter</span> <span class="special">&gt;</span> <a name="id1896748-bb"></a><span class="keyword">operator</span><span class="special">++</span><span class="special">(</span><span class="keyword">int</span><span class="special">)</span><span class="special">;</span></pre></li>
116 </ol></div>
117 </div>
118 </div>
119 </div>
120 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
121 <td align="left"></td>
122 <td align="right"><div class="copyright-footer">Copyright &#169; 2007 Eric Niebler<p>
123         Distributed under the Boost Software License, Version 1.0. (See accompanying
124         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>)
125       </p>
126 </div></td>
127 </tr></table>
128 <hr>
129 <div class="spirit-nav">
130 <a accesskey="p" href="../../BOOST_XPR_ENSURE_.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../xpressive/reference.html#header.boost.xpressive.regex_iterator_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="mark_tag.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
131 </div>
132 </body>
133 </html>