| 1 | <html> |
|---|
| 2 | <head> |
|---|
| 3 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
|---|
| 4 | <title>Struct template basic_regex</title> |
|---|
| 5 | <link rel="stylesheet" href="../../boostbook.css" type="text/css"> |
|---|
| 6 | <meta name="generator" content="DocBook XSL Stylesheets V1.68.1"> |
|---|
| 7 | <link rel="start" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> |
|---|
| 8 | <link rel="up" href="../../xpressive/reference.html#header.boost.xpressive.basic_regex.hpp" title="Header <boost/xpressive/basic_regex.hpp>"> |
|---|
| 9 | <link rel="prev" href="../../xpressive/reference.html" title="Reference"> |
|---|
| 10 | <link rel="next" href="../../id1668860-bb.html" title="Function template swap"> |
|---|
| 11 | </head> |
|---|
| 12 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
|---|
| 13 | <table cellpadding="2" width="100%"> |
|---|
| 14 | <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td> |
|---|
| 15 | <td align="center"><a href="../../../../index.htm">Home</a></td> |
|---|
| 16 | <td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td> |
|---|
| 17 | <td align="center"><a href="../../../../people/people.htm">People</a></td> |
|---|
| 18 | <td align="center"><a href="../../../../more/faq.htm">FAQ</a></td> |
|---|
| 19 | <td align="center"><a href="../../../../more/index.htm">More</a></td> |
|---|
| 20 | </table> |
|---|
| 21 | <hr> |
|---|
| 22 | <div class="spirit-nav"> |
|---|
| 23 | <a accesskey="p" href="../../xpressive/reference.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../../xpressive/reference.html#header.boost.xpressive.basic_regex.hpp"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../../id1668860-bb.html"><img src="../../images/next.png" alt="Next"></a> |
|---|
| 24 | </div> |
|---|
| 25 | <div class="refentry" lang="en"> |
|---|
| 26 | <a name="boost.xpressive.basic_regex"></a><div class="titlepage"></div> |
|---|
| 27 | <div class="refnamediv"> |
|---|
| 28 | <h2><span class="refentrytitle">Struct template basic_regex</span></h2> |
|---|
| 29 | <p>boost::xpressive::basic_regex — Class template basic_regex<> is a class for holding a compiled regular expression. </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="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> BidiIter> |
|---|
| 33 | <span class="bold"><strong>struct</strong></span> basic_regex { |
|---|
| 34 | <span class="emphasis"><em>// types</em></span> |
|---|
| 35 | <span class="bold"><strong>typedef</strong></span> BidiIter iterator_type; |
|---|
| 36 | <span class="bold"><strong>typedef</strong></span> iterator_value< BidiIter >::type char_type; |
|---|
| 37 | <span class="bold"><strong>typedef</strong></span> std::basic_string< char_type > string_type; |
|---|
| 38 | <span class="bold"><strong>typedef</strong></span> regex_constants::syntax_option_type flag_type; |
|---|
| 39 | |
|---|
| 40 | <span class="emphasis"><em>// <a href="basic_regex.html#boost.xpressive.basic_regexconstruct-copy-destruct">construct/copy/destruct</a></em></span> |
|---|
| 41 | <a href="basic_regex.html#id1564922-bb">basic_regex</a>(); |
|---|
| 42 | <a href="basic_regex.html#id1564933-bb">basic_regex</a>(<a href="basic_regex.html" title="Struct template basic_regex">basic_regex</a>< BidiIter > <span class="bold"><strong>const</strong></span> &); |
|---|
| 43 | <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Xpr> <a href="basic_regex.html#id1600100-bb">basic_regex</a>(Xpr <span class="bold"><strong>const</strong></span> &); |
|---|
| 44 | basic_regex& <a href="basic_regex.html#id1564958-bb"><span class="bold"><strong>operator</strong></span>=</a>(<a href="basic_regex.html" title="Struct template basic_regex">basic_regex</a>< BidiIter > <span class="bold"><strong>const</strong></span> &); |
|---|
| 45 | <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Xpr> basic_regex& <a href="basic_regex.html#id867620-bb"><span class="bold"><strong>operator</strong></span>=</a>(Xpr <span class="bold"><strong>const</strong></span> &); |
|---|
| 46 | |
|---|
| 47 | <span class="emphasis"><em>// <a href="basic_regex.html#id1564854-bb">public member functions</a></em></span> |
|---|
| 48 | <span class="type">std::size_t</span> <a href="basic_regex.html#id1564858-bb">mark_count</a>() <span class="bold"><strong>const</strong></span>; |
|---|
| 49 | <span class="type">regex_id_type</span> <a href="basic_regex.html#id1564870-bb">regex_id</a>() <span class="bold"><strong>const</strong></span>; |
|---|
| 50 | <span class="type"><span class="bold"><strong>void</strong></span></span> <a href="basic_regex.html#id1564882-bb">swap</a>(<a href="basic_regex.html" title="Struct template basic_regex">basic_regex</a>< BidiIter > &) ; |
|---|
| 51 | |
|---|
| 52 | <span class="emphasis"><em>// <a href="basic_regex.html#id1668806-bb">public static functions</a></em></span> |
|---|
| 53 | <span class="type"><span class="bold"><strong>static</strong></span> <a href="basic_regex.html" title="Struct template basic_regex">basic_regex</a>< BidiIter ></span> |
|---|
| 54 | <a href="basic_regex.html#id1668810-bb">compile</a>(string_type <span class="bold"><strong>const</strong></span> &, flag_type = regex_constants::ECMAScript) ; |
|---|
| 55 | };</pre></div> |
|---|
| 56 | <div class="refsect1" lang="en"> |
|---|
| 57 | <a name="id2014124"></a><h2>Description</h2> |
|---|
| 58 | <div class="refsect2" lang="en"> |
|---|
| 59 | <a name="id2014127"></a><h3> |
|---|
| 60 | <a name="boost.xpressive.basic_regexconstruct-copy-destruct"></a><code class="computeroutput">basic_regex</code> construct/copy/destruct</h3> |
|---|
| 61 | <div class="orderedlist"><ol type="1"> |
|---|
| 62 | <li> |
|---|
| 63 | <pre class="literallayout"><a name="id1564922-bb"></a>basic_regex();</pre> |
|---|
| 64 | <p> |
|---|
| 65 | </p> |
|---|
| 66 | <div class="variablelist"><table border="0"> |
|---|
| 67 | <col align="left" valign="top"> |
|---|
| 68 | <tbody><tr> |
|---|
| 69 | <td> |
|---|
| 70 | <span class="term">Postconditions:</span></td> |
|---|
| 71 | <td> |
|---|
| 72 | <p>regex_id() == 0 </p> |
|---|
| 73 | <p>mark_count() == 0 </p> |
|---|
| 74 | </td> |
|---|
| 75 | </tr></tbody> |
|---|
| 76 | </table></div> |
|---|
| 77 | </li> |
|---|
| 78 | <li> |
|---|
| 79 | <pre class="literallayout"><a name="id1564933-bb"></a>basic_regex(<a href="basic_regex.html" title="Struct template basic_regex">basic_regex</a>< BidiIter > <span class="bold"><strong>const</strong></span> & that);</pre> |
|---|
| 80 | <p> |
|---|
| 81 | |
|---|
| 82 | </p> |
|---|
| 83 | <div class="variablelist"><table border="0"> |
|---|
| 84 | <col align="left" valign="top"> |
|---|
| 85 | <tbody> |
|---|
| 86 | <tr> |
|---|
| 87 | <td> |
|---|
| 88 | <span class="term">Parameters:</span></td> |
|---|
| 89 | <td><div class="variablelist"><table border="0"> |
|---|
| 90 | <col align="left" valign="top"> |
|---|
| 91 | <tbody><tr> |
|---|
| 92 | <td> |
|---|
| 93 | <span class="term"><code class="computeroutput">that</code></span></td> |
|---|
| 94 | <td><p>The basic_regex object to copy. </p></td> |
|---|
| 95 | </tr></tbody> |
|---|
| 96 | </table></div></td> |
|---|
| 97 | </tr> |
|---|
| 98 | <tr> |
|---|
| 99 | <td> |
|---|
| 100 | <span class="term">Postconditions:</span></td> |
|---|
| 101 | <td> |
|---|
| 102 | <p>regex_id() == that.regex_id() </p> |
|---|
| 103 | <p>mark_count() == that.mark_count() </p> |
|---|
| 104 | </td> |
|---|
| 105 | </tr> |
|---|
| 106 | </tbody> |
|---|
| 107 | </table></div> |
|---|
| 108 | </li> |
|---|
| 109 | <li> |
|---|
| 110 | <pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Xpr> <a name="id1600100-bb"></a>basic_regex(Xpr <span class="bold"><strong>const</strong></span> & xpr);</pre> |
|---|
| 111 | <p>Construct from a static regular expression.</p> |
|---|
| 112 | <p> |
|---|
| 113 | |
|---|
| 114 | |
|---|
| 115 | </p> |
|---|
| 116 | <div class="variablelist"><table border="0"> |
|---|
| 117 | <col align="left" valign="top"> |
|---|
| 118 | <tbody> |
|---|
| 119 | <tr> |
|---|
| 120 | <td> |
|---|
| 121 | <span class="term">Parameters:</span></td> |
|---|
| 122 | <td><div class="variablelist"><table border="0"> |
|---|
| 123 | <col align="left" valign="top"> |
|---|
| 124 | <tbody><tr> |
|---|
| 125 | <td> |
|---|
| 126 | <span class="term"><code class="computeroutput">xpr</code></span></td> |
|---|
| 127 | <td><p>The static regular expression </p></td> |
|---|
| 128 | </tr></tbody> |
|---|
| 129 | </table></div></td> |
|---|
| 130 | </tr> |
|---|
| 131 | <tr> |
|---|
| 132 | <td> |
|---|
| 133 | <span class="term">Requires:</span></td> |
|---|
| 134 | <td><p>Xpr is the type of a static regular expression. </p></td> |
|---|
| 135 | </tr> |
|---|
| 136 | <tr> |
|---|
| 137 | <td> |
|---|
| 138 | <span class="term">Postconditions:</span></td> |
|---|
| 139 | <td> |
|---|
| 140 | <p>regex_id() != 0 </p> |
|---|
| 141 | <p>mark_count() >= 0 </p> |
|---|
| 142 | </td> |
|---|
| 143 | </tr> |
|---|
| 144 | </tbody> |
|---|
| 145 | </table></div> |
|---|
| 146 | </li> |
|---|
| 147 | <li> |
|---|
| 148 | <pre class="literallayout">basic_regex& <a name="id1564958-bb"></a><span class="bold"><strong>operator</strong></span>=(<a href="basic_regex.html" title="Struct template basic_regex">basic_regex</a>< BidiIter > <span class="bold"><strong>const</strong></span> & that);</pre> |
|---|
| 149 | <p> |
|---|
| 150 | |
|---|
| 151 | |
|---|
| 152 | </p> |
|---|
| 153 | <div class="variablelist"><table border="0"> |
|---|
| 154 | <col align="left" valign="top"> |
|---|
| 155 | <tbody> |
|---|
| 156 | <tr> |
|---|
| 157 | <td> |
|---|
| 158 | <span class="term">Parameters:</span></td> |
|---|
| 159 | <td><div class="variablelist"><table border="0"> |
|---|
| 160 | <col align="left" valign="top"> |
|---|
| 161 | <tbody><tr> |
|---|
| 162 | <td> |
|---|
| 163 | <span class="term"><code class="computeroutput">that</code></span></td> |
|---|
| 164 | <td><p>The basic_regex object to copy. </p></td> |
|---|
| 165 | </tr></tbody> |
|---|
| 166 | </table></div></td> |
|---|
| 167 | </tr> |
|---|
| 168 | <tr> |
|---|
| 169 | <td> |
|---|
| 170 | <span class="term">Postconditions:</span></td> |
|---|
| 171 | <td> |
|---|
| 172 | <p>regex_id() == that.regex_id() </p> |
|---|
| 173 | <p>mark_count() == that.mark_count() </p> |
|---|
| 174 | </td> |
|---|
| 175 | </tr> |
|---|
| 176 | <tr> |
|---|
| 177 | <td> |
|---|
| 178 | <span class="term">Returns:</span></td> |
|---|
| 179 | <td><p>*this </p></td> |
|---|
| 180 | </tr> |
|---|
| 181 | </tbody> |
|---|
| 182 | </table></div> |
|---|
| 183 | </li> |
|---|
| 184 | <li> |
|---|
| 185 | <pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Xpr> basic_regex& <a name="id867620-bb"></a><span class="bold"><strong>operator</strong></span>=(Xpr <span class="bold"><strong>const</strong></span> & xpr);</pre> |
|---|
| 186 | <p>Construct from a static regular expression.</p> |
|---|
| 187 | <p> |
|---|
| 188 | |
|---|
| 189 | |
|---|
| 190 | |
|---|
| 191 | |
|---|
| 192 | </p> |
|---|
| 193 | <div class="variablelist"><table border="0"> |
|---|
| 194 | <col align="left" valign="top"> |
|---|
| 195 | <tbody> |
|---|
| 196 | <tr> |
|---|
| 197 | <td> |
|---|
| 198 | <span class="term">Parameters:</span></td> |
|---|
| 199 | <td><div class="variablelist"><table border="0"> |
|---|
| 200 | <col align="left" valign="top"> |
|---|
| 201 | <tbody><tr> |
|---|
| 202 | <td> |
|---|
| 203 | <span class="term"><code class="computeroutput">xpr</code></span></td> |
|---|
| 204 | <td><p>The static regular expression. </p></td> |
|---|
| 205 | </tr></tbody> |
|---|
| 206 | </table></div></td> |
|---|
| 207 | </tr> |
|---|
| 208 | <tr> |
|---|
| 209 | <td> |
|---|
| 210 | <span class="term">Requires:</span></td> |
|---|
| 211 | <td><p>Xpr is the type of a static regular expression. </p></td> |
|---|
| 212 | </tr> |
|---|
| 213 | <tr> |
|---|
| 214 | <td> |
|---|
| 215 | <span class="term">Postconditions:</span></td> |
|---|
| 216 | <td> |
|---|
| 217 | <p>regex_id() != 0 </p> |
|---|
| 218 | <p>mark_count() >= 0 </p> |
|---|
| 219 | </td> |
|---|
| 220 | </tr> |
|---|
| 221 | <tr> |
|---|
| 222 | <td> |
|---|
| 223 | <span class="term">Returns:</span></td> |
|---|
| 224 | <td><p>*this </p></td> |
|---|
| 225 | </tr> |
|---|
| 226 | <tr> |
|---|
| 227 | <td> |
|---|
| 228 | <span class="term">Throws:</span></td> |
|---|
| 229 | <td>std::bad_alloc on out of memory </td> |
|---|
| 230 | </tr> |
|---|
| 231 | </tbody> |
|---|
| 232 | </table></div> |
|---|
| 233 | </li> |
|---|
| 234 | </ol></div> |
|---|
| 235 | </div> |
|---|
| 236 | <div class="refsect2" lang="en"> |
|---|
| 237 | <a name="id2014496"></a><h3> |
|---|
| 238 | <a name="id1564854-bb"></a><code class="computeroutput">basic_regex</code> public member functions</h3> |
|---|
| 239 | <div class="orderedlist"><ol type="1"> |
|---|
| 240 | <li> |
|---|
| 241 | <pre class="literallayout"><span class="type">std::size_t</span> <a name="id1564858-bb"></a>mark_count() <span class="bold"><strong>const</strong></span>;</pre> |
|---|
| 242 | <p>Returns the count of capturing sub-expressions in this regular expression </p> |
|---|
| 243 | </li> |
|---|
| 244 | <li> |
|---|
| 245 | <pre class="literallayout"><span class="type">regex_id_type</span> <a name="id1564870-bb"></a>regex_id() <span class="bold"><strong>const</strong></span>;</pre> |
|---|
| 246 | <p>Returns a token which uniquely identifies this regular expression. </p> |
|---|
| 247 | </li> |
|---|
| 248 | <li> |
|---|
| 249 | <pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id1564882-bb"></a>swap(<a href="basic_regex.html" title="Struct template basic_regex">basic_regex</a>< BidiIter > & that) ;</pre> |
|---|
| 250 | <p>Swaps the contents of this basic_regex object with another.</p> |
|---|
| 251 | <p> |
|---|
| 252 | |
|---|
| 253 | |
|---|
| 254 | </p> |
|---|
| 255 | <div class="variablelist"><table border="0"> |
|---|
| 256 | <col align="left" valign="top"> |
|---|
| 257 | <tbody> |
|---|
| 258 | <tr> |
|---|
| 259 | <td> |
|---|
| 260 | <span class="term">Parameters:</span></td> |
|---|
| 261 | <td><div class="variablelist"><table border="0"> |
|---|
| 262 | <col align="left" valign="top"> |
|---|
| 263 | <tbody><tr> |
|---|
| 264 | <td> |
|---|
| 265 | <span class="term"><code class="computeroutput">that</code></span></td> |
|---|
| 266 | <td><p>The other basic_regex object. </p></td> |
|---|
| 267 | </tr></tbody> |
|---|
| 268 | </table></div></td> |
|---|
| 269 | </tr> |
|---|
| 270 | <tr> |
|---|
| 271 | <td> |
|---|
| 272 | <span class="term">Throws:</span></td> |
|---|
| 273 | <td>Will not throw.</td> |
|---|
| 274 | </tr> |
|---|
| 275 | <tr> |
|---|
| 276 | <td> |
|---|
| 277 | <span class="term">Notes:</span></td> |
|---|
| 278 | <td><p>This is a shallow swap that does not do reference tracking. If you embed a basic_regex object by reference in another regular expression and then swap its contents with another basic_regex object, the change will not be visible to the enclosing regular expression. It is done this way to ensure that swap() cannot throw. </p></td> |
|---|
| 279 | </tr> |
|---|
| 280 | </tbody> |
|---|
| 281 | </table></div> |
|---|
| 282 | </li> |
|---|
| 283 | </ol></div> |
|---|
| 284 | </div> |
|---|
| 285 | <div class="refsect2" lang="en"> |
|---|
| 286 | <a name="id2014643"></a><h3> |
|---|
| 287 | <a name="id1668806-bb"></a><code class="computeroutput">basic_regex</code> public static functions</h3> |
|---|
| 288 | <div class="orderedlist"><ol type="1"><li> |
|---|
| 289 | <pre class="literallayout"><span class="type"><span class="bold"><strong>static</strong></span> <a href="basic_regex.html" title="Struct template basic_regex">basic_regex</a>< BidiIter ></span> |
|---|
| 290 | <a name="id1668810-bb"></a>compile(string_type <span class="bold"><strong>const</strong></span> & str, |
|---|
| 291 | flag_type flags = regex_constants::ECMAScript) ;</pre> |
|---|
| 292 | <p>Factory method for building a regex object from a string. Equivalent to regex_compiler< BidiIter >().compile(str, flags);</p> |
|---|
| 293 | <p> |
|---|
| 294 | </p> |
|---|
| 295 | <div class="variablelist"><table border="0"> |
|---|
| 296 | <col align="left" valign="top"> |
|---|
| 297 | <tbody><tr> |
|---|
| 298 | <td> |
|---|
| 299 | <span class="term">Parameters:</span></td> |
|---|
| 300 | <td><div class="variablelist"><table border="0"> |
|---|
| 301 | <col align="left" valign="top"> |
|---|
| 302 | <tbody> |
|---|
| 303 | <tr> |
|---|
| 304 | <td> |
|---|
| 305 | <span class="term"><code class="computeroutput">flags</code></span></td> |
|---|
| 306 | <td><p>Optional bitmask of type syntax_option_type to control how str is interpreted. </p></td> |
|---|
| 307 | </tr> |
|---|
| 308 | <tr> |
|---|
| 309 | <td> |
|---|
| 310 | <span class="term"><code class="computeroutput">str</code></span></td> |
|---|
| 311 | <td><p>The std::basic_string containing the regular expression. </p></td> |
|---|
| 312 | </tr> |
|---|
| 313 | </tbody> |
|---|
| 314 | </table></div></td> |
|---|
| 315 | </tr></tbody> |
|---|
| 316 | </table></div> |
|---|
| 317 | </li></ol></div> |
|---|
| 318 | </div> |
|---|
| 319 | </div> |
|---|
| 320 | </div> |
|---|
| 321 | <table width="100%"><tr> |
|---|
| 322 | <td align="left"></td> |
|---|
| 323 | <td align="right"><small>Copyright © 2003, 2004 Eric Niebler</small></td> |
|---|
| 324 | </tr></table> |
|---|
| 325 | <hr> |
|---|
| 326 | <div class="spirit-nav"> |
|---|
| 327 | <a accesskey="p" href="../../xpressive/reference.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../../xpressive/reference.html#header.boost.xpressive.basic_regex.hpp"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../../id1668860-bb.html"><img src="../../images/next.png" alt="Next"></a> |
|---|
| 328 | </div> |
|---|
| 329 | </body> |
|---|
| 330 | </html> |
|---|