• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5<title>Struct template regex_iterator</title>
6<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
7<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
8<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
9<link rel="up" href="../../xpressive/reference.html#header.boost.xpressive.xpressive_fwd_hpp" title="Header &lt;boost/xpressive/xpressive_fwd.hpp&gt;">
10<link rel="prev" href="regex_id_filter_predicate.html" title="Struct template regex_id_filter_predicate">
11<link rel="next" href="regex_token_iterator.html" title="Struct template regex_token_iterator">
12</head>
13<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
14<table cellpadding="2" width="100%"><tr>
15<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
16<td align="center"><a href="../../../../index.html">Home</a></td>
17<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
18<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
19<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
20<td align="center"><a href="../../../../more/index.htm">More</a></td>
21</tr></table>
22<hr>
23<div class="spirit-nav">
24<a accesskey="p" href="regex_id_filter_predicate.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../xpressive/reference.html#header.boost.xpressive.xpressive_fwd_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="regex_token_iterator.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
25</div>
26<div class="refentry">
27<a name="boost.xpressive.regex_iterator"></a><div class="titlepage"></div>
28<div class="refnamediv">
29<h2><span class="refentrytitle">Struct template regex_iterator</span></h2>
30<p>boost::xpressive::regex_iterator</p>
31</div>
32<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
33<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.xpressive_fwd_hpp" title="Header &lt;boost/xpressive/xpressive_fwd.hpp&gt;">boost/xpressive/xpressive_fwd.hpp</a>&gt;
34
35</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> BidiIter<span class="special">&gt;</span>
36<span class="keyword">struct</span> <a class="link" href="regex_iterator.html" title="Struct template regex_iterator">regex_iterator</a> <span class="special">{</span>
37  <span class="comment">// <a class="link" href="regex_iterator.html#boost.xpressive.regex_iteratorconstruct-copy-destruct">construct/copy/destruct</a></span>
38  <a class="link" href="regex_iterator.html#id-1_3_47_5_18_2_1_13_3-bb"><span class="identifier">regex_iterator</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
39  <a class="link" href="regex_iterator.html#id-1_3_47_5_18_2_1_13_4-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>
40                 <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>
41  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> LetExpr<span class="special">&gt;</span>
42    <a class="link" href="regex_iterator.html#id-1_3_47_5_18_2_1_13_5-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>
43                   <span class="emphasis"><em><span class="identifier">unspecified</span></em></span><span class="special">,</span>
44                   <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>
45  <a class="link" href="regex_iterator.html#id-1_3_47_5_18_2_1_13_6-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>
46  <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#id-1_3_47_5_18_2_1_13_7-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>
47
48  <span class="comment">// <a class="link" href="regex_iterator.html#id-1_3_47_5_18_2_1_13_2-bb">public member functions</a></span>
49  <span class="identifier">value_type</span> <span class="keyword">const</span>  <span class="special">&amp;</span> <a class="link" href="regex_iterator.html#id-1_3_47_5_18_2_1_13_2_1-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>
50  <span class="identifier">value_type</span> <span class="keyword">const</span>  <span class="special">*</span> <a class="link" href="regex_iterator.html#id-1_3_47_5_18_2_1_13_2_2-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>
51  <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#id-1_3_47_5_18_2_1_13_2_3-bb"><span class="keyword">operator</span><span class="special">++</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
52  <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#id-1_3_47_5_18_2_1_13_2_4-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>
53<span class="special">}</span><span class="special">;</span></pre></div>
54<div class="refsect1">
55<a name="id-1.3.47.5.19.23.4"></a><h2>Description</h2>
56<div class="refsect2">
57<a name="id-1.3.47.5.19.23.4.2"></a><h3>
58<a name="boost.xpressive.regex_iteratorconstruct-copy-destruct"></a><code class="computeroutput">regex_iterator</code>
59        public
60       construct/copy/destruct</h3>
61<div class="orderedlist"><ol class="orderedlist" type="1">
62<li class="listitem"><pre class="literallayout"><a name="id-1_3_47_5_18_2_1_13_3-bb"></a><span class="identifier">regex_iterator</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li>
63<li class="listitem"><pre class="literallayout"><a name="id-1_3_47_5_18_2_1_13_4-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>
64               <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>
65               <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>
66<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>
67  <a name="id-1_3_47_5_18_2_1_13_5-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>
68                 <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>
69                 <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>
70<li class="listitem"><pre class="literallayout"><a name="id-1_3_47_5_18_2_1_13_6-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>
71<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> <span class="special">&amp;</span>
72<a name="id-1_3_47_5_18_2_1_13_7-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>
73</ol></div>
74</div>
75<div class="refsect2">
76<a name="id-1.3.47.5.19.23.4.3"></a><h3>
77<a name="id-1_3_47_5_18_2_1_13_2-bb"></a><code class="computeroutput">regex_iterator</code> public member functions</h3>
78<div class="orderedlist"><ol class="orderedlist" type="1">
79<li class="listitem"><pre class="literallayout"><span class="identifier">value_type</span> <span class="keyword">const</span>  <span class="special">&amp;</span> <a name="id-1_3_47_5_18_2_1_13_2_1-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>
80<li class="listitem"><pre class="literallayout"><span class="identifier">value_type</span> <span class="keyword">const</span>  <span class="special">*</span> <a name="id-1_3_47_5_18_2_1_13_2_2-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>
81<li class="listitem">
82<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="id-1_3_47_5_18_2_1_13_2_3-bb"></a><span class="keyword">operator</span><span class="special">++</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
83<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.
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98</p>
99<div class="variablelist"><table border="0" class="variablelist compact">
100<colgroup>
101<col align="left" valign="top">
102<col>
103</colgroup>
104<tbody>
105<tr>
106<td><p><span class="term">Postconditions:</span></p></td>
107<td><p>(*this)-&gt;size() == pre-&gt;mark_count() + 1 </p></td>
108</tr>
109<tr>
110<td><p><span class="term">Postconditions:</span></p></td>
111<td><p>(*this)-&gt;empty() == false </p></td>
112</tr>
113<tr>
114<td><p><span class="term">Postconditions:</span></p></td>
115<td><p>(*this)-&gt;prefix().first == An iterator denoting the end point of the previous match found </p></td>
116</tr>
117<tr>
118<td><p><span class="term">Postconditions:</span></p></td>
119<td><p>(*this)-&gt;prefix().last == (**this)[0].first </p></td>
120</tr>
121<tr>
122<td><p><span class="term">Postconditions:</span></p></td>
123<td><p>(*this)-&gt;prefix().matched == (*this)-&gt;prefix().first != (*this)-&gt;prefix().second </p></td>
124</tr>
125<tr>
126<td><p><span class="term">Postconditions:</span></p></td>
127<td><p>(*this)-&gt;suffix().first == (**this)[0].second </p></td>
128</tr>
129<tr>
130<td><p><span class="term">Postconditions:</span></p></td>
131<td><p>(*this)-&gt;suffix().last == end </p></td>
132</tr>
133<tr>
134<td><p><span class="term">Postconditions:</span></p></td>
135<td><p>(*this)-&gt;suffix().matched == (*this)-&gt;suffix().first != (*this)-&gt;suffix().second </p></td>
136</tr>
137<tr>
138<td><p><span class="term">Postconditions:</span></p></td>
139<td><p>(**this)[0].first == The starting iterator for this match. </p></td>
140</tr>
141<tr>
142<td><p><span class="term">Postconditions:</span></p></td>
143<td><p>(**this)[0].second == The ending iterator for this match. </p></td>
144</tr>
145<tr>
146<td><p><span class="term">Postconditions:</span></p></td>
147<td><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></td>
148</tr>
149<tr>
150<td><p><span class="term">Postconditions:</span></p></td>
151<td><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></td>
152</tr>
153<tr>
154<td><p><span class="term">Postconditions:</span></p></td>
155<td><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></td>
156</tr>
157<tr>
158<td><p><span class="term">Postconditions:</span></p></td>
159<td><p>(**this)[n].matched == For all integers n &lt; (*this)-&gt;size(), true if sub-expression n participated in the match, false otherwise. </p></td>
160</tr>
161<tr>
162<td><p><span class="term">Postconditions:</span></p></td>
163<td><p>(*this)-&gt;position() == The distance from the start of the original sequence being iterated, to the start of this match. </p></td>
164</tr>
165</tbody>
166</table></div>
167</li>
168<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="id-1_3_47_5_18_2_1_13_2_4-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>
169</ol></div>
170</div>
171</div>
172</div>
173<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
174<td align="left"></td>
175<td align="right"><div class="copyright-footer">Copyright © 2007 Eric Niebler<p>
176        Distributed under the Boost Software License, Version 1.0. (See accompanying
177        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>)
178      </p>
179</div></td>
180</tr></table>
181<hr>
182<div class="spirit-nav">
183<a accesskey="p" href="regex_id_filter_predicate.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../xpressive/reference.html#header.boost.xpressive.xpressive_fwd_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="regex_token_iterator.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
184</div>
185</body>
186</html>
187