Updated docs to include recent changes, and improve general quality.

[SVN r20443]
This commit is contained in:
John Maddock
2003-10-21 11:18:40 +00:00
parent 72a7a13565
commit 515044821c
28 changed files with 3764 additions and 4430 deletions

File diff suppressed because it is too large Load Diff

View File

@ -3,108 +3,83 @@
<head> <head>
<title>Boost.Regex: Contacts</title> <title>Boost.Regex: Contacts</title>
<meta name="generator" content="HTML Tidy, see www.w3.org"> <meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content= <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
"text/html; charset=iso-8859-1" >
<link rel="stylesheet" type="text/css" href="../../../boost.css"> <link rel="stylesheet" type="text/css" href="../../../boost.css">
</head> </head>
<body> <body>
<p></p> <p></p>
<table id="Table1" cellspacing="1" cellpadding="1" width="100%" border="0">
<table id="Table1" cellspacing="1" cellpadding="1" width="100%"
border="0">
<tr> <tr>
<td valign="top" width="300"> <td valign="top" width="300">
<h3><a href="../../../index.htm"><img height="86" width="277" alt= <h3><a href="../../../index.htm"><IMG height="86" alt="C++ Boost" src="../../../c++boost.gif" width="277" border="0"></a></h3>
"C++ Boost" src="../../../c++boost.gif" border=0></a></h3>
</td> </td>
<td width="353"> <td width="353">
<h1 align="center">Boost.Regex</h1> <h1 align="center">Boost.Regex</h1>
<h2 align="center">Contacts and Acknowledgements</h2> <h2 align="center">Contacts and Acknowledgements</h2>
</td> </td>
<td width="50"> <td width="50">
<h3><a href="index.html"><img height="45" width="43" alt= <h3><a href="index.html"><IMG height="45" alt="Boost.Regex Index" src="uarrow.gif" width="43" border="0"></a></h3>
"Boost.Regex Index" src="uarrow.gif" border=0></a></h3>
</td> </td>
</tr> </tr>
</table> </table>
<BR>
<br> <BR>
<br> <HR>
<P>The author can be contacted at <A href="mailto:john@johnmaddock.co.uk">john@johnmaddock.co.uk</A>;&nbsp;the
home page for this library is at <A href="http://www.boost.org">www.boost.org</A>.</P>
<hr> <P>I am indebted to Robert Sedgewick's "Algorithms in C++" for forcing me to think
<p>The author can be contacted at <a href="mailto:john_maddock@compuserve.com"> about algorithms and their performance, and to the folks at boost for forcing
john_maddock@compuserve.com</a>, the home page for this library is me to <I>think</I>, period. The following people have all contributed useful
at <a href="http://ourworld.compuserve.com/homepages/john_maddock/regexpp.htm"> comments or fixes: Dave Abrahams, Mike Allison, Edan Ayal, Jayashree
http://ourworld.compuserve.com/homepages/john_maddock/regexpp.htm</a>, Balasubramanian, Jan B<>lsche, Beman Dawes, Paul Baxter, David Bergman, David
and the official boost version can be obtained from <a href="../../libraries.htm">www.boost.org/libraries.htm</a>.</p> Dennerline, Edward Diener, Peter Dimov, Robert Dunn, Fabio Forno, Tobias
Gabrielsson, Rob Gillen, Marc Gregoire, Chris Hecker, Nick Hodapp, Jesse Jones,
<p>I am indebted to Robert Sedgewick's "Algorithms in C++" for Martin Jost, Boris Krasnovskiy, Jan Hermelink, Max Leung, Wei-hao Lin, Jens
forcing me to think about algorithms and their performance, and to Maurer, Richard Peters, Heiko Schmidt, Jason Shirk, Gerald Slacik, Scobie
the folks at boost for forcing me to <i>think</i>, period. The Smith, Mike Smyth, Alexander Sokolovsky, Herv<72> Poirier, Michael Raykh, Marc
following people have all contributed useful comments or fixes: Recht, Scott VanCamp, Bruno Voigt, Alexey Voinov, Jerry Waldorf, Rob Ward,
Dave Abrahams, Mike Allison, Edan Ayal, Jayashree Balasubramanian, Lealon Watts, Thomas Witt and Yuval Yosef. I am also grateful to the manuals
Jan B<>lsche, Beman Dawes, Paul Baxter, David Bergman, David supplied with the Henry Spencer, Perl and GNU regular expression libraries -
Dennerline, Edward Diener, Peter Dimov, Robert Dunn, Fabio Forno, wherever possible I have tried to maintain compatibility with these libraries
Tobias Gabrielsson, Rob Gillen, Marc Gregoire, Chris Hecker, Nick and with the POSIX standard - the code however is entirely my own, including
Hodapp, Jesse Jones, Martin Jost, Boris Krasnovskiy, Jan Hermelink, any bugs! I can absolutely guarantee that I will not fix any bugs I don't know
Max Leung, Wei-hao Lin, Jens Maurer, Richard Peters, Heiko Schmidt, about, so if you have any comments or spot any bugs, please get in touch.</P>
Jason Shirk, Gerald Slacik, Scobie Smith, Mike Smyth, Alexander <P>Useful further information can be found at:</P>
Sokolovsky, Herv<72> Poirier, Michael Raykh, Marc Recht, Scott <P>Short&nbsp;tutorials on regular expressions can be <A href="http://etext.lib.virginia.edu/helpsheets/regex.html">
VanCamp, Bruno Voigt, Alexey Voinov, Jerry Waldorf, Rob Ward, found here</A> and&nbsp;<A href="http://www.devshed.com/Server_Side/Administration/RegExp/page1.html">here</A>.</P>
Lealon Watts, Thomas Witt and Yuval Yosef. I am also grateful to <P>The main book on regular expressions is <A href="http://www.oreilly.com/catalog/regex/">
the manuals supplied with the Henry Spencer, Perl and GNU regular Mastering Regular Expressions, published by O'Reilly</A>.</P>
expression libraries - wherever possible I have tried to maintain <P>Information on the <A href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1429.htm">
compatibility with these libraries and with the POSIX standard - Boost.regex standardization proposal</A>, along with other <A href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1475.html">
the code however is entirely my own, including any bugs! I can standard library extension proposals</A> can be found on the <A href="http://anubis.dkuug.dk/jtc1/sc22/wg21/">
absolutely guarantee that I will not fix any bugs I don't know C++ Committees web pages</A>.</P>
about, so if you have any comments or spot any bugs, please get in <P>The<a href="http://www.opengroup.org/onlinepubs/7908799/toc.htm">Open Unix
touch.</p> Specification</a> contains a wealth of useful material, including the
regular expression syntax, and specifications for <a href="http://www.opengroup.org/onlinepubs/7908799/xsh/regex.h.html">
<p>Useful further information can be found at:</p>
<p>A short tutorial on regular expressions <a href="http://www.devshed.com/Server_Side/Administration/RegExp/">can be
found here</a>.</p>
<p>The <a href="http://www.opengroup.org/onlinepubs/7908799/toc.htm">Open Unix
Specification</a> contains a wealth of useful material, including
the regular expression syntax, and specifications for <a href="http://www.opengroup.org/onlinepubs/7908799/xsh/regex.h.html">
&lt;regex.h&gt;</a> and <a href="http://www.opengroup.org/onlinepubs/7908799/xsh/nl_types.h.html"> &lt;regex.h&gt;</a> and <a href="http://www.opengroup.org/onlinepubs/7908799/xsh/nl_types.h.html">
&lt;nl_types.h&gt;</a>.</p> &lt;nl_types.h&gt;</a>.</P>
<p>The <a href="http://www.cs.ucr.edu/~stelo/pattern.html">Pattern Matching Pointers</a>
<p>The <a href="http://www.cs.ucr.edu/~stelo/pattern.html">Pattern site is a "must visit" resource for anyone interested in pattern matching.</p>
Matching Pointers</a> site is a "must visit" resource for anyone <p><a href="http://glimpse.cs.arizona.edu/">Glimpse and Agrep</a>, use a
interested in pattern matching.</p> simplified regular expression syntax to achieve faster search times.</p>
<p><a href="http://glimpse.cs.arizona.edu/udi.html">Udi Manber</a> and <a href="http://www.dcc.uchile.cl/~rbaeza/">
<p><a href="http://glimpse.cs.arizona.edu/">Glimpse and Agrep</a>, Ricardo Baeza-Yates</a> both have a selection of useful pattern matching
use a simplified regular expression syntax to achieve faster search
times.</p>
<p><a href="http://glimpse.cs.arizona.edu/udi.html">Udi Manber</a>
and <a href="http://www.dcc.uchile.cl/~rbaeza/">Ricardo
Baeza-Yates</a> both have a selection of useful pattern matching
papers available from their respective web sites.</p> papers available from their respective web sites.</p>
<p></p> <p></p>
<hr> <hr>
<p>Revised <p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->17 May 2003 <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
17 May 2003
<!--webbot bot="Timestamp" endspan i-checksum="39359" --></p> <!--webbot bot="Timestamp" endspan i-checksum="39359" --></p>
<p><i><EFBFBD> Copyright <a href="mailto:jm@regex.fsnet.co.uk">John Maddock</a>&nbsp;1998-
<p><i><EFBFBD> Copyright <a href="mailto:jm@regex.fsnet.co.uk">John <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan -->
Maddock</a>&nbsp;1998- 2003
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan -->2003
<!--webbot bot="Timestamp" endspan i-checksum="39359" --></i></p> <!--webbot bot="Timestamp" endspan i-checksum="39359" --></i></p>
<p align="left"><i>Permission to use, copy, modify, distribute and sell this software
<p align="left"><i>Permission to use, copy, modify, distribute and and its documentation for any purpose is hereby granted without fee, provided
sell this software and its documentation for any purpose is hereby that the above copyright notice appear in all copies and that both that
granted without fee, provided that the above copyright notice copyright notice and this permission notice appear in supporting documentation.
appear in all copies and that both that copyright notice and this Dr John Maddock makes no representations about the suitability of this software
permission notice appear in supporting documentation. Dr John for any purpose. It is provided "as is" without express or implied warranty.</i></p>
Maddock makes no representations about the suitability of this
software for any purpose. It is provided "as is" without express or
implied warranty.</i></p>
</body> </body>
</html> </html>

View File

@ -28,16 +28,19 @@
<UL> <UL>
<LI> <LI>
Completely rewritten pattern matching code - it is now up to 10 times faster Completely rewritten pattern matching code - it is now up to 10 times faster
than before.</LI> than before.
<LI> <LI>
Reorganized documentation.</LI> Reorganized documentation.
<LI> <LI>
Deprecated all interfaces that are not part of the <A href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1429.htm"> Deprecated all interfaces that are not part of the <A href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1429.htm">
regular expression standardization proposal</A>.</LI> regular expression standardization proposal</A>.
<LI> <LI>
Added regex_iterator and regex_token_iterator.</LI> Added regex_iterator and regex_token_iterator.
<LI> <LI>
Added support for Perl style independent sub-expressions.</LI></UL> Added support for Perl style independent sub-expressions.
<LI>
Added non-member operators to the sub_match class, so that you can compare
sub_match's with strings, or add them to a string to produce a new string.</LI></UL>
<P> <P>
<HR> <HR>
<P></P> <P></P>
@ -55,4 +58,3 @@
for any purpose. It is provided "as is" without express or implied warranty.</I></P> for any purpose. It is provided "as is" without express or implied warranty.</I></P>
</body> </body>
</html> </html>

View File

@ -62,7 +62,7 @@
to be hard-coded to the C-locale, consequently this was not an issue for them). to be hard-coded to the C-locale, consequently this was not an issue for them).
That leaves us with the following regular expression to validate credit card That leaves us with the following regular expression to validate credit card
number formats:</P> number formats:</P>
<P>(\d{4}[- ]){3}\d{4}</P> <PRE>(\d{4}[- ]){3}\d{4}</PRE>
<P>Here the parenthesis act to group (and mark for future reference) <P>Here the parenthesis act to group (and mark for future reference)
sub-expressions, and the {4} means "repeat exactly 4 times". This is an example sub-expressions, and the {4} means "repeat exactly 4 times". This is an example
of the extended regular expression syntax used by Perl, awk and egrep. Regex++ of the extended regular expression syntax used by Perl, awk and egrep. Regex++
@ -93,8 +93,9 @@
need two strings - one a regular expression - the other a "<A href="format_syntax.html">format need two strings - one a regular expression - the other a "<A href="format_syntax.html">format
string</A>" that provides a description of the text to replace the match string</A>" that provides a description of the text to replace the match
with. In regex++ this search and replace operation is performed with the with. In regex++ this search and replace operation is performed with the
algorithm regex_replace, for our credit card example we can write two algorithms algorithm<A href="regex_replace.html"> regex_replace</A>, for our credit card
like this to provide the format conversions:</P> example we can write two algorithms like this to provide the format
conversions:</P>
<PRE><I>// match any format with the regular expression: <PRE><I>// match any format with the regular expression:
</I><B>const</B> boost::regex e("\\A(\\d{3,4})[- ]?(\\d{4})[- ]?(\\d{4})[- ]?(\\d{4})\\z"); </I><B>const</B> boost::regex e("\\A(\\d{3,4})[- ]?(\\d{4})[- ]?(\\d{4})[- ]?(\\d{4})\\z");
<B>const</B> std::string machine_format("\\1\\2\\3\\4"); <B>const</B> std::string machine_format("\\1\\2\\3\\4");
@ -126,22 +127,31 @@ std::string human_readable_card_number(<B>const</B> std::string s)
<STRONG>typedef</STRONG> match_results&lt;std::string::const_iterator&gt; smatch; <STRONG>typedef</STRONG> match_results&lt;std::string::const_iterator&gt; smatch;
<STRONG>typedef</STRONG> match_results&lt;std::wstring::const_iterator&gt; wsmatch; <STRONG>typedef</STRONG> match_results&lt;std::wstring::const_iterator&gt; wsmatch;
}</PRE> }</PRE>
<P>The algorithms <A href="regex_search.html">regex_search</A> and <A href="regex_grep.html"> <P>The algorithms <A href="regex_search.html">regex_search</A> and&nbsp;<A href="regex_match.html">regex_match</A>
regex_grep</A> (i.e. finding all matches in a string) make use of make use of match_results to report what matched; the difference between these
match_results to report what matched.</P> algorithms is that <A href="regex_match.html">regex_match</A> will only find
matches that consume <EM>all</EM> of the input text, where as <A href="regex_search.html">
regex_search</A> will <EM>search</EM> for a match anywhere within the text
being matched.</P>
<P>Note that these algorithms are not restricted to searching regular C-strings, <P>Note that these algorithms are not restricted to searching regular C-strings,
any bidirectional iterator type can be searched, allowing for the possibility any bidirectional iterator type can be searched, allowing for the possibility
of seamlessly searching almost any kind of data. of seamlessly searching almost any kind of data.
</P> </P>
<P>For search and replace operations in addition to the algorithm <A href="regex_replace.html"> <P>For search and replace operations, in addition to the algorithm <A href="regex_replace.html">
regex_replace</A> that we have already seen, the algorithm <A href="regex_format.html"> regex_replace</A> that we have already seen, the <A href="match_results.html">match_results</A>
regex_format</A> takes the result of a match and a format string, and class has a format member that takes the result of a match and a format string,
produces a new string by merging the two.</P> and produces a new string by merging the two.</P>
<P>For iterating through all occurences of an expression within a text, there are
two iterator types: <A href="regex_iterator.html">regex_iterator</A> will
enumerate over the <A href="match_results.html">match_results</A> objects
found, while <A href="regex_token_iterator.html">regex_token_iterator</A> will
enumerate a series of strings (similar to perl style split operations).</P>
<P>For those that dislike templates, there is a high level wrapper class RegEx <P>For those that dislike templates, there is a high level wrapper class RegEx
that is an encapsulation of the lower level template code - it provides a that is an encapsulation of the lower level template code - it provides a
simplified interface for those that don't need the full power of the library, simplified interface for those that don't need the full power of the library,
and supports only narrow characters, and the "extended" regular expression and supports only narrow characters, and the "extended" regular expression
syntax. syntax. This class is now deprecated as it does not form part of the regular
expressions C++ standard library proposal.
</P> </P>
<P>The <A href="posix_api.html">POSIX API</A> functions: regcomp, regexec, regfree <P>The <A href="posix_api.html">POSIX API</A> functions: regcomp, regexec, regfree
and regerror, are available in both narrow character and Unicode versions, and and regerror, are available in both narrow character and Unicode versions, and
@ -171,6 +181,3 @@ std::string human_readable_card_number(<B>const</B> std::string s)
for any purpose. It is provided "as is" without express or implied warranty.</I></P> for any purpose. It is provided "as is" without express or implied warranty.</I></P>
</body> </body>
</html> </html>

View File

@ -1,45 +1,35 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html> <html>
<head> <head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<title>Boost.Regex: match_flag_type</title> <title>Boost.Regex: match_flag_type</title>
<meta http-equiv="Content-Type" content= <meta name="generator" content="HTML Tidy, see www.w3.org">
"text/html; charset=iso-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../../boost.css"> <link rel="stylesheet" type="text/css" href="../../../boost.css">
</head> </head>
<body> <body>
<p></p> <p></p>
<table id="Table1" cellspacing="1" cellpadding="1" width="100%" border="0">
<table id="Table1" cellspacing="1" cellpadding="1" width="100%"
border="0">
<tr> <tr>
<td valign="top" width="300"> <td valign="top" width="300">
<h3><a href="../../../index.htm"><img height="86" width="277" alt= <h3><a href="../../../index.htm"><img height="86" width="277" alt="C++ Boost" src="../../../c++boost.gif" border="0"></a></h3>
"C++ Boost" src="../../../c++boost.gif" border="0"></a></h3>
</td> </td>
<td width="353"> <td width="353">
<h1 align="center">Boost.Regex</h1> <h1 align="center">Boost.Regex</h1>
<h2 align="center">match_flag_type</h2> <h2 align="center">match_flag_type</h2>
</td> </td>
<td width="50"> <td width="50">
<h3><a href="index.html"><img height="45" width="43" alt= <h3><a href="index.html"><img height="45" width="43" alt="Boost.Regex Index" src="uarrow.gif" border="0"></a></h3>
"Boost.Regex Index" src="uarrow.gif" border="0"></a></h3>
</td> </td>
</tr> </tr>
</table> </table>
<br> <br>
<br> <br>
<hr> <hr>
<h3>Synopsis</h3> <h3>Synopsis</h3>
<p>The type <code>match_flag_type</code> is an implementation defined bitmask type
<p>The type <code>match_flag_type</code> is an implementation (17.3.2.1.2) that controls how a regular expression is matched against a
defined bitmask type (17.3.2.1.2) that controls how a regular character sequence.&nbsp; The behavior of the format flags is descibed in more
expression is matched against a character sequence.</p> detail in the <A href="format_syntax.html">format syntax guide</A>.</p>
<pre> <pre>
namespace std{ namespace regex_constants{ namespace std{ namespace regex_constants{
@ -70,18 +60,13 @@ static const match_flag_type format_all;
} // namespace regex_constants } // namespace regex_constants
} // namespace std } // namespace std
</pre> </pre>
<h3>Description</h3> <h3>Description</h3>
<p>The type <code>match_flag_type</code> is an implementation defined bitmask type
<p>The type <code>match_flag_type</code> is an implementation (17.3.2.1.2). When matching a regular expression against a sequence of
defined bitmask type (17.3.2.1.2). When matching a regular characters [first, last) then setting its elements has the effects listed in
expression against a sequence of characters [first, last) then the table below:</p>
setting its elements has the effects listed in the table below:</p>
<p></p> <p></p>
<table id="Table2" cellspacing="1" cellpadding="7" width="100%" border="0">
<table id="Table2" cellspacing="1" cellpadding="7" width="100%"
border="0">
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Element</p> <p>Element</p>
@ -90,241 +75,198 @@ border="0">
<p>Effect if set</p> <p>Effect if set</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>match_default</p> <p>match_default</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that matching of regular expressions proceeds without <p>Specifies that matching of regular expressions proceeds without any
any modification of the normal rules used in ECMA-262, ECMAScript modification of the normal rules used in ECMA-262, ECMAScript Language
Language Specification, Chapter 15 part 10, RegExp (Regular Specification, Chapter 15 part 10, RegExp (Regular Expression) Objects (FWD.1)</p>
Expression) Objects (FWD.1)</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%">match_not_bob</td> <td valign="top" width="50%">match_not_bob</td>
<td valign="top" width="50%">Specifies that the expression "\A" <td valign="top" width="50%">Specifies that the expression "\A" should not match
should not match against the sub-sequence [first,first).</td> against the sub-sequence [first,first).</td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%">match_not_eob</td> <td valign="top" width="50%">match_not_eob</td>
<td valign="top" width="50%">Specifies that the expressions "\z" <td valign="top" width="50%">Specifies that the expressions "\z" and
and "\Z"&nbsp;should not match against the sub-sequence "\Z"&nbsp;should not match against the sub-sequence [last,last).</td>
[last,last).</td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>match_not_bol</p> <p>match_not_bol</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that the expression "^" should not be matched against <p>Specifies that the expression "^" should not be matched against the
the sub-sequence [first,first).</p> sub-sequence [first,first).</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>match_not_eol</p> <p>match_not_eol</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that the expression "$" should not be matched against <p>Specifies that the expression "$" should not be matched against the
the sub-sequence [last,last).</p> sub-sequence [last,last).</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>match_not_bow</p> <p>match_not_bow</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that the expression "\b" should not be matched against <p>Specifies that the expression "\b" should not be matched against the
the sub-sequence [first,first).</p> sub-sequence [first,first).</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>match_not_eow</p> <p>match_not_eow</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that the expression "\b" should not be matched against <p>Specifies that the expression "\b" should not be matched against the
the sub-sequence [last,last).</p> sub-sequence [last,last).</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>match_any</p> <p>match_any</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that if more than one match is possible then any match <p>Specifies that if more than one match is possible then any match is an
is an acceptable result.</p> acceptable result.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>match_not_null</p> <p>match_not_null</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that the expression can not be matched against an <p>Specifies that the expression can not be matched against an empty sequence.</p>
empty sequence.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>match_continuous</p> <p>match_continuous</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that the expression must match a sub-sequence that <p>Specifies that the expression must match a sub-sequence that begins at <i>first</i>.</p>
begins at <i>first</i>.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>match_partial</p> <p>match_partial</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that if no match can be found, then it is acceptable <p>Specifies that if no match can be found, then it is acceptable to return a
to return a match [from, last) where from!=last, if there exists match [from, last) where from!=last, if there exists some sequence of
some sequence of characters [from,to) of which [from,last) is a characters [from,to) of which [from,last) is a prefix, and which would result
prefix, and which would result in a full match.</p> in a full match.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>match_prev_avail</p> <p>match_prev_avail</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that <code>--first</code> is a valid iterator <p>Specifies that <code>--first</code> is a valid iterator position, when this
position, when this flag is set then the flags <code> flag is set then the flags <code>match_not_bol</code> and <code>match_not_bow</code>
match_not_bol</code> and <code>match_not_bow</code> are ignored by are ignored by the regular expression algorithms (RE.7) and iterators (RE.8).</p>
the regular expression algorithms (RE.7) and iterators (RE.8).</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%">match_not_dot_newline</td> <td valign="top" width="50%">match_not_dot_newline</td>
<td valign="top" width="50%">Specifies that the expression "." does <td valign="top" width="50%">Specifies that the expression "." does not match a
not match a newline character.</td> newline character.</td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%">match_not_dot_null</td> <td valign="top" width="50%">match_not_dot_null</td>
<td valign="top" width="50%">Specified that the expression "." does <td valign="top" width="50%">Specified that the expression "." does not match a
not match a character null '\0'.</td> character null '\0'.</td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>format_default</p> <p>format_default</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that when a regular expression match is to be replaced <p>Specifies that when a regular expression match is to be replaced by a new
by a new string, that the new string is constructed using the rules string, that the new string is constructed using the rules used by the
used by the ECMAScript replace function in ECMA-262, ECMAScript ECMAScript replace function in ECMA-262, ECMAScript Language Specification,
Language Specification, Chapter 15 part 5.4.11 Chapter 15 part 5.4.11 String.prototype.replace. (FWD.1). In addition during
String.prototype.replace. (FWD.1). In addition during search and search and replace operations then all non-overlapping occurrences of the
replace operations then all non-overlapping occurrences of the regular expression are located and replaced, and sections of the input that did
regular expression are located and replaced, and sections of the not match the expression, are copied unchanged to the output string.</p>
input that did not match the expression, are copied unchanged to
the output string.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>format_sed</p> <p>format_sed</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that when a regular expression match is to be replaced <p>Specifies that when a regular expression match is to be replaced by a new
by a new string, that the new string is constructed using the rules string, that the new string is constructed using the rules used by the Unix sed
used by the Unix sed utility in IEEE Std 1003.1-2001, Portable utility in IEEE Std 1003.1-2001, Portable Operating SystemInterface (POSIX ),
Operating SystemInterface (POSIX ), Shells and Utilities..</p> Shells and Utilities..</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>format_perl</p> <p>format_perl</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that when a regular expression match is to be replaced <p>
by a new string, that the new string is constructed using an Specifies that when a regular expression match is to be replaced by a new
implementation defined superset of the rules used by the ECMAScript string, that the new string is constructed using the same rules as Perl 5.</p>
replace function in ECMA-262, ECMAScript Language Specification,
Chapter 15 part 5.4.11 String.prototype.replace (FWD.1).</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%" height="32">format_all</td> <td valign="top" width="50%" height="32">format_all</td>
<td valign="top" width="50%" height="32">Specifies that all syntax <td valign="top" width="50%" height="32">Specifies that all syntax extensions are
extensions are enabled, including conditional enabled, including conditional (?ddexpression1:expression2) replacements: see
(?ddexpression1:expression2) replacements.</td> the <A href="format_syntax.html">format string guide</A> for more details.</td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>format_no_copy</p> <p>format_no_copy</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>When specified during a search and replace operation, then <p>When specified during a search and replace operation, then sections of the
sections of the character container sequence being searched that do character container sequence being searched that do match the regular
match the regular expression, are not copied to the output expression, are not copied to the output string.</p>
string.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>format_first_only</p> <p>format_first_only</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>When specified during a search and replace operation, then only <p>When specified during a search and replace operation, then only the first
the first occurrence of the regular expression is replaced.</p> occurrence of the regular expression is replaced.</p>
</td> </td>
</tr> </tr>
</table> </table>
<br> <br>
<br> <br>
<p></p> <p></p>
<hr> <hr>
<br> <br>
<br> <br>
<p>Revised <p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan --> <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
17 May 2003 17 May 2003
<!--webbot bot="Timestamp" endspan i-checksum="39359" --></p> <!--webbot bot="Timestamp" endspan i-checksum="39359" --></p>
<p><i><EFBFBD> Copyright <a href="mailto:jm@regex.fsnet.co.uk">John Maddock</a>&nbsp;1998-
<p><i>&copy; Copyright <a href="mailto:jm@regex.fsnet.co.uk">John
Maddock</a>&nbsp;1998-
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan --> <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan -->
2003 2003
<!--webbot bot="Timestamp" endspan i-checksum="39359" --></i></p> <!--webbot bot="Timestamp" endspan i-checksum="39359" --></i></p>
<p align="left"><i>Permission to use, copy, modify, distribute and sell this software
<p align="left"><i>Permission to use, copy, modify, distribute and and its documentation for any purpose is hereby granted without fee, provided
sell this software and its documentation for any purpose is hereby that the above copyright notice appear in all copies and that both that
granted without fee, provided that the above copyright notice copyright notice and this permission notice appear in supporting documentation.
appear in all copies and that both that copyright notice and this Dr John Maddock makes no representations about the suitability of this software
permission notice appear in supporting documentation. Dr John for any purpose. It is provided "as is" without express or implied warranty.</i></p>
Maddock makes no representations about the suitability of this
software for any purpose. It is provided "as is" without express or
implied warranty.</i></p>
</body> </body>
</html> </html>

View File

@ -1,76 +1,56 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html> <html>
<head> <head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<title>Boost.Regex: class match_results</title> <title>Boost.Regex: class match_results</title>
<meta http-equiv="Content-Type" content= <meta name="generator" content="HTML Tidy, see www.w3.org">
"text/html; charset=iso-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../../boost.css"> <link rel="stylesheet" type="text/css" href="../../../boost.css">
</head> </head>
<body> <body>
<p></p> <p></p>
<table id="Table1" cellspacing="1" cellpadding="1" width="100%" border="0">
<table id="Table1" cellspacing="1" cellpadding="1" width="100%"
border="0">
<tr> <tr>
<td valign="top" width="300"> <td valign="top" width="300">
<h3><a href="../../../index.htm"><img height="86" width="277" alt= <h3><a href="../../../index.htm"><img height="86" width="277" alt="C++ Boost" src="../../../c++boost.gif" border="0"></a></h3>
"C++ Boost" src="../../../c++boost.gif" border="0"></a></h3>
</td> </td>
<td width="353"> <td width="353">
<h1 align="center">Boost.Regex</h1> <h1 align="center">Boost.Regex</h1>
<h2 align="center">class match_results</h2> <h2 align="center">class match_results</h2>
</td> </td>
<td width="50"> <td width="50">
<h3><a href="index.html"><img height="45" width="43" alt= <h3><a href="index.html"><img height="45" width="43" alt="Boost.Regex Index" src="uarrow.gif" border="0"></a></h3>
"Boost.Regex Index" src="uarrow.gif" border="0"></a></h3>
</td> </td>
</tr> </tr>
</table> </table>
<br> <br>
<br> <br>
<hr> <hr>
<h3>Contents</h3> <h3>Contents</h3>
<dl class="index"> <dl class="index">
<dt><a href="#synopsis">Synopsis</a></dt> <dt><a href="#synopsis">Synopsis</a> <dt><a href="#description">Description</a></dt>
<dt><a href="#description">Description</a></dt>
</dl> </dl>
<h3><a name="synopsis"></a>Synopsis</h3> <h3><a name="synopsis"></a>Synopsis</h3>
<p>#include &lt;<a href="../../../boost/regex.hpp">boost/regex.hpp</a>&gt;</p> <p>#include &lt;<a href="../../../boost/regex.hpp">boost/regex.hpp</a>&gt;</p>
<p>Regular expressions are different from many simple pattern-matching algorithms
<p>Regular expressions are different from many simple in that as well as finding an overall match they can also produce
pattern-matching algorithms in that as well as finding an overall sub-expression matches: each sub-expression being delimited in the pattern by a
match they can also produce sub-expression matches: each pair of parenthesis (...). There has to be some method for reporting
sub-expression being delimited in the pattern by a pair of sub-expression matches back to the user: this is achieved this by defining a
parenthesis (...). There has to be some method for reporting class <i>match_results</i> that acts as an indexed collection of sub-expression
sub-expression matches back to the user: this is achieved this by matches, each sub-expression match being contained in an object of type <i><a href="sub_match.html">
defining a class <i>match_results</i> that acts as an indexed
collection of sub-expression matches, each sub-expression match
being contained in an object of type <i><a href="sub_match.html">
sub_match</a></i> .</p> sub_match</a></i> .</p>
<p>Template class match_results denotes a collection of character sequences
<p>Template class match_results denotes a collection of character representing the result of a regular expression match. Objects of type
sequences representing the result of a regular expression match. match_results are passed to the algorithms <a href="regex_match.html">regex_match</a>
Objects of type match_results are passed to the algorithms <a href="regex_match.html">regex_match</a> and <a href="regex_search.html"> and <a href="regex_search.html">regex_search</a>, and are returned by the
regex_search</a>, and are returned by the iterator <a href="regex_iterator.html">regex_iterator</a> .&nbsp; Storage for the iterator <a href="regex_iterator.html">regex_iterator</a> .&nbsp; Storage for
collection is allocated and freed as necessary by the member the collection is allocated and freed as necessary by the member functions of
functions of class match_results.</p> class match_results.</p>
<p>The template class match_results conforms to the requirements of a Sequence, as
<p>The template class match_results conforms to the requirements of specified in (lib.sequence.reqmts), except that only operations defined for
a Sequence, as specified in (lib.sequence.reqmts), except that only const-qualified Sequences are supported.</p>
operations defined for const-qualified Sequences are supported.</p> <p>Class template match_results is most commonly used as one of the typedefs
cmatch, wcmatch, smatch, or wsmatch:</p>
<p>Class template match_results is most commonly used as one of the
typedefs cmatch, wcmatch, smatch, or wsmatch:</p>
<pre> <pre>
template &lt;class BidirectionalIterator, template &lt;class BidirectionalIterator,
class Allocator = allocator&lt;sub_match&lt;BidirectionalIterator&gt; &gt; class Allocator = allocator&lt;sub_match&lt;BidirectionalIterator&gt; &gt;
@ -98,77 +78,68 @@ public:
typedef basic_string&lt;char_type&gt; string_type; typedef basic_string&lt;char_type&gt; string_type;
// construct/copy/destroy: // construct/copy/destroy:
explicit match_results(const Allocator&amp; a = Allocator()); explicit <A href="#c1">match_results</A>(const Allocator&amp; a = Allocator());
match_results(const match_results&amp; m); <A href="#c2">match_results</A>(const match_results&amp; m);
match_results&amp; operator=(const match_results&amp; m); <A href="#c3">match_results</A>&amp; <A href="#c3">operator</A>=(const match_results&amp; m);
~match_results(); ~match_results();
// size: // size:
size_type size() const; size_type <A href="#m1">size</A>() const;
size_type max_size() const; size_type <A href="#m2">max_size</A>() const;
bool empty() const; bool <A href="#m3">empty</A>() const;
// element access: // element access:
difference_type length(int sub = 0) const; difference_type <A href="#m4">length</A>(int sub = 0) const;
difference_type position(unsigned int sub = 0) const; difference_type <A href="#m5">position</A>(unsigned int sub = 0) const;
string_type str(int sub = 0) const; string_type <A href="#m6">str</A>(int sub = 0) const;
const_reference operator[](int n) const; const_reference <A href="#m7">operator</A>[](int n) const;
const_reference prefix() const; const_reference <A href="#m8">prefix</A>() const;
const_reference suffix() const; const_reference <A href="#m9">suffix</A>() const;
const_iterator begin() const; const_iterator <A href="#m10">begin</A>() const;
const_iterator end() const; const_iterator <A href="#m11">end</A>() const;
// format: // format:
template &lt;class OutputIterator&gt; template &lt;class OutputIterator&gt;
OutputIterator format(OutputIterator out, OutputIterator <A href="#m12">format</A>(OutputIterator out,
const string_type&amp; fmt, const string_type&amp; fmt,
match_flag_type flags = format_default) const; match_flag_type flags = format_default) const;
string_type format(const string_type&amp; fmt, string_type <A href="#m13">format</A>(const string_type&amp; fmt,
match_flag_type flags = format_default) const; match_flag_type flags = format_default) const;
allocator_type get_allocator() const; allocator_type <A href="#m14">get_allocator</A>() const;
void swap(match_results&amp; that); void <A href="#m15">swap</A>(match_results&amp; that);
}; };
template &lt;class BidirectionalIterator, class Allocator&gt; template &lt;class BidirectionalIterator, class Allocator&gt;
bool operator == (const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m1, bool <A href="#n1">operator</A> == (const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m1,
const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m2); const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m2);
template &lt;class BidirectionalIterator, class Allocator&gt; template &lt;class BidirectionalIterator, class Allocator&gt;
bool operator != (const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m1, bool <A href="#n2">operator</A> != (const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m1,
const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m2); const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m2);
template &lt;class charT, class traits, class BidirectionalIterator, class Allocator&gt; template &lt;class charT, class traits, class BidirectionalIterator, class Allocator&gt;
basic_ostream&lt;charT, traits&gt;&amp; basic_ostream&lt;charT, traits&gt;&amp;
operator &lt;&lt; (basic_ostream&lt;charT, traits&gt;&amp; os, <A href="#n3">operator</A> &lt;&lt; (basic_ostream&lt;charT, traits&gt;&amp; os,
const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m); const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m);
template &lt;class BidirectionalIterator, class Allocator&gt; template &lt;class BidirectionalIterator, class Allocator&gt;
void swap(match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m1, void <A href="#n4">swap</A>(match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m1,
match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m2); match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m2);
</pre> </pre>
<h3><a name="description"></a>Description</h3> <h3><a name="description"></a>Description</h3>
<h4>match_results constructors</h4> <h4>match_results constructors</h4>
<p>In all <code>match_results</code> constructors, a copy of the Allocator
<p>In all <code>match_results</code> constructors, a copy of the argument is used for any memory allocation performed by the constructor or
Allocator argument is used for any memory allocation performed by member functions during the lifetime of the object.</p>
the constructor or member functions during the lifetime of the <pre><A name=c1></A>
object.</p>
<pre>
match_results(const Allocator&amp; a = Allocator()); match_results(const Allocator&amp; a = Allocator());
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Constructs an object of class match_results. The <p><b>Effects:</b> Constructs an object of class match_results. The postconditions
postconditions of this function are indicated in the table:</p> of this function are indicated in the table:</p>
<p align="center"></p> <p align="center"></p>
<center> <center>
<table id="Table2" cellspacing="1" cellpadding="7" width="624" <table id="Table2" cellspacing="1" cellpadding="7" width="624" border="1">
border="1">
<tbody> <tbody>
<tr> <tr>
<td valign="top" width="50%"><b></b> <td valign="top" width="50%"><b></b>
@ -178,7 +149,6 @@ border="1">
<p><b>Value</b></p> <p><b>Value</b></p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>empty()</p> <p>empty()</p>
@ -187,7 +157,6 @@ border="1">
<p>true</p> <p>true</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>size()</p> <p>size()</p>
@ -196,7 +165,6 @@ border="1">
<p>0</p> <p>0</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>str()</p> <p>str()</p>
@ -208,30 +176,21 @@ border="1">
</tbody> </tbody>
</table> </table>
</center> </center>
<p>&nbsp;</p> <p>&nbsp;</p>
<pre><A name=c2></A>
<pre>
match_results(const match_results&amp; m); match_results(const match_results&amp; m);
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Constructs an object of class match_results, as <p><b>Effects:</b> Constructs an object of class match_results, as a copy of m.</p>
a copy of m.</p> <pre><A name=c3></A>
<pre>
match_results&amp; operator=(const match_results&amp; m); match_results&amp; operator=(const match_results&amp; m);
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Assigns m to *this. The postconditions of this <p><b>Effects:</b> Assigns m to *this. The postconditions of this function are
function are indicated in the table:</p> indicated in the table:</p>
<p align="center"></p> <p align="center"></p>
<center> <center>
<table id="Table3" cellspacing="1" cellpadding="7" width="624" <table id="Table3" cellspacing="1" cellpadding="7" width="624" border="1">
border="1">
<tbody> <tbody>
<tr> <tr>
<td valign="top" width="50%"><b></b> <td valign="top" width="50%"><b></b>
@ -241,7 +200,6 @@ border="1">
<p><b>Value</b></p> <p><b>Value</b></p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>empty()</p> <p>empty()</p>
@ -250,7 +208,6 @@ border="1">
<p>m.empty().</p> <p>m.empty().</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>size()</p> <p>size()</p>
@ -259,7 +216,6 @@ border="1">
<p>m.size().</p> <p>m.size().</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>str(n)</p> <p>str(n)</p>
@ -268,7 +224,6 @@ border="1">
<p>m.str(n) for all integers n &lt; m.size().</p> <p>m.str(n) for all integers n &lt; m.size().</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>prefix()</p> <p>prefix()</p>
@ -277,7 +232,6 @@ border="1">
<p>m.prefix().</p> <p>m.prefix().</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>suffix()</p> <p>suffix()</p>
@ -286,7 +240,6 @@ border="1">
<p>m.suffix().</p> <p>m.suffix().</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>(*this)[n]</p> <p>(*this)[n]</p>
@ -295,7 +248,6 @@ border="1">
<p>m[n] for all integers n &lt; m.size().</p> <p>m[n] for all integers n &lt; m.size().</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>length(n)</p> <p>length(n)</p>
@ -304,7 +256,6 @@ border="1">
<p>m.length(n) for all integers n &lt; m.size().</p> <p>m.length(n) for all integers n &lt; m.size().</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>position(n)</p> <p>position(n)</p>
@ -316,196 +267,165 @@ border="1">
</tbody> </tbody>
</table> </table>
</center> </center>
<h4>match_results size</h4> <h4>match_results size</h4>
<pre><A name=m1></A>
<pre>
size_type size()const; size_type size()const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns the number of sub_match elements stored <p><b>Effects:</b> Returns the number of sub_match elements stored in *this; that
in *this.</p> is the number of marked sub-expressions in the regular expression that was
matched plus one.</p>
<pre> <pre><A name=m2></A>
size_type max_size()const; size_type max_size()const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns the maximum number of sub_match elements <p><b>Effects:</b> Returns the maximum number of sub_match elements that can be
that can be stored in *this.</p> stored in *this.</p>
<pre><A name=m3></A>
<pre>
bool empty()const; bool empty()const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns <code>size() == 0</code>.</p> <p><b>Effects:</b> Returns <code>size() == 0</code>.</p>
<h4>match_results element access</h4> <h4>match_results element access</h4>
<pre><A name=m4></A>
<pre>
difference_type length(int sub = 0)const; difference_type length(int sub = 0)const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns <code>(*this)[sub].length()</code>.</p> <p><b>Effects:</b> Returns the length of sub-expression <EM>sub</EM>, that is to
say: <code>(*this)[sub].length()</code>.</p>
<pre> <pre><A name=m5></A>
difference_type position(unsigned int sub = 0)const; difference_type position(unsigned int sub = 0)const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns <code>std::distance(prefix().first, <p><b>Effects:</b> Returns the starting location of sub-expression <EM>sub</EM>,
(*this)[sub].first).</code></p> or -1 if <EM>sub</EM> was not matched <code>.</code></p>
<pre><A name=m6></A>
<pre>
string_type str(int sub = 0)const; string_type str(int sub = 0)const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns <code> <p><b>Effects:</b> Returns sub-expression <EM>sub</EM> as a string:&nbsp; <code>string_type((*this)[sub]).</code></p>
string_type((*this)[sub]).</code></p> <pre><A name=m7></A>
<pre>
const_reference operator[](int n) const; const_reference operator[](int n) const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns a reference to the <code> <p><b>Effects:</b> Returns a reference to the <code>sub_match</code> object
sub_match</code> object representing the character sequence that representing the character sequence that matched marked sub-expression <i>n</i>.
matched marked sub-expression <i>n</i>. If <code>n == 0</code> then If <code>n == 0</code> then returns a reference to a <code>sub_match</code> object
returns a reference to a <code>sub_match</code> object representing representing the character sequence that matched the whole regular
the character sequence that matched the whole regular expression.&nbsp; If <EM>n</EM> is out of range, or if <EM>n</EM> is an
expression.</p> unmatched sub-expression, then returns a sub_match object whose <EM>matched</EM>
member is <EM>false</EM>.</p>
<pre> <pre><A name=m8></A>
const_reference prefix()const; const_reference prefix()const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns a reference to the <code> <p><b>Effects:</b> Returns a reference to the <code>sub_match</code> object
sub_match</code> object representing the character sequence from representing the character sequence from the start of the string being
the start of the string being matched/searched, to the start of the matched/searched, to the start of the match found.</p>
match found.</p> <pre><A name=m9></A>
<pre>
const_reference suffix()const; const_reference suffix()const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns a reference to the <code> <p><b>Effects:</b> Returns a reference to the <code>sub_match</code> object
sub_match</code> object representing the character sequence from representing the character sequence from the end of the match found to the end
the end of the match found to the end of the string being of the string being matched/searched.</p>
matched/searched.</p> <pre><A name=m10></A>
<pre>
const_iterator begin()const; const_iterator begin()const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns a starting iterator that enumerates over <p><b>Effects:</b> Returns a starting iterator that enumerates over all the marked
all the marked sub-expression matches stored in *this.</p> sub-expression matches stored in *this.</p>
<pre><A name=m11></A>
<pre>
const_iterator end()const; const_iterator end()const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns a terminating iterator that enumerates <p><b>Effects:</b> Returns a terminating iterator that enumerates over all the
over all the marked sub-expression matches stored in *this.</p> marked sub-expression matches stored in *this.</p>
<h4><A name="format"></A>match_results reformatting</h4>
<h4>match_results reformatting</h4> <pre><A name=m12></A>
<pre>
template &lt;class OutputIterator&gt; template &lt;class OutputIterator&gt;
OutputIterator format(OutputIterator out, OutputIterator format(OutputIterator out,
const string_type&amp; fmt, const string_type&amp; fmt,
<a href="match_flag_type.html">match_flag_type</a> flags = format_default); <a href="match_flag_type.html">match_flag_type</a> flags = format_default);
</pre> </pre>
<b></b> <b></b>
<p><b>Requires:</b> The type OutputIterator conforms to the Output <p><b>Requires:</b> The type OutputIterator conforms to the Output Iterator
Iterator requirements (24.1.2).</p> requirements (24.1.2).</p>
<b></b> <b></b>
<p><b>Effects:</b> Copies the character sequence <i>[fmt.begin(), <p><b>Effects:</b> Copies the character sequence <i>[fmt.begin(), fmt.end())</i> to
fmt.end())</i> to OutputIterator <i>out</i>. For each format OutputIterator <i>out</i>. For each format specifier or escape sequence in <i>fmt</i>,
specifier or escape sequence in <i>fmt</i>, replace that sequence replace that sequence with either the character(s) it represents, or the
with either the character(s) it represents, or the sequence of sequence of characters within *this to which it refers. The bitmasks specified
characters within *this to which it refers. The bitmasks specified in <i><a href="match_flag_type.html">flags</a></i> determines what <a href="format_syntax.html">
in <i><a href="match_flag_type.html">flags</a></i> determines what format specifiers or escape sequences are recognized</a>, by default this is
<a href="format_syntax.html">format specifiers or escape sequences the format used by ECMA-262, ECMAScript Language Specification, Chapter 15 part
are recognized</a>, by default this is the format used by ECMA-262, 5.4.11 String.prototype.replace.</p>
ECMAScript Language Specification, Chapter 15 part 5.4.11
String.prototype.replace.</p>
<b></b> <b></b>
<p><b>Returns:</b> <i>out</i>.</p> <p><b>Returns:</b> <i>out</i>.</p>
<pre><A name=m13></A>
<pre>
string_type format(const string_type&amp; fmt, string_type format(const string_type&amp; fmt,
<a href="match_flag_type.html">match_flag_type</a> flags = format_default); <a href="match_flag_type.html">match_flag_type</a> flags = format_default);
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns a copy of the string <i>fmt</i>. For <p><b>Effects:</b> Returns a copy of the string <i>fmt</i>. For each format
each format specifier or escape sequence in <i>fmt</i>, replace specifier or escape sequence in <i>fmt</i>, replace that sequence with either
that sequence with either the character(s) it represents, or the the character(s) it represents, or the sequence of characters within *this to
sequence of characters within *this to which it refers. The which it refers. The bitmasks specified in <i><a href="match_flag_type.html">flags</a></i>
bitmasks specified in <i><a href="match_flag_type.html"> determines what <a href="format_syntax.html">format specifiers or escape sequences
flags</a></i> determines what <a href="format_syntax.html">format are recognized</a>, by default this is the format used by ECMA-262,
specifiers or escape sequences are recognized</a>, by default this ECMAScript Language Specification, Chapter 15 part 5.4.11
is the format used by ECMA-262, ECMAScript Language Specification, String.prototype.replace.</p>
Chapter 15 part 5.4.11 String.prototype.replace.</p> <pre><A name=m14></A>
<pre>
allocator_type get_allocator()const; allocator_type get_allocator()const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns a copy of the Allocator that was passed <p><b>Effects:</b> Returns a copy of the Allocator that was passed to the object's
to the object's constructor.</p> constructor.</p>
<pre><A name=m15></A>
<pre>
void swap(match_results&amp; that); void swap(match_results&amp; that);
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Swaps the contents of the two sequences.</p> <p><b>Effects:</b> Swaps the contents of the two sequences.</p>
<b></b> <b></b>
<p><b>Postcondition:</b> <code>*this</code> contains the sequence <p><b>Postcondition:</b> <code>*this</code> contains the sequence of matched
of matched sub-expressions that were in <code>that</code>, <code> sub-expressions that were in <code>that</code>, <code>that</code> contains the
that</code> contains the sequence of matched sub-expressions that sequence of matched sub-expressions that were in <code>*this</code>.</p>
were in <code>*this</code>.</p>
<b></b> <b></b>
<p><b>Complexity:</b> constant time.</p> <p><b>Complexity:</b> constant time.</p>
<h4>match_results non-members</h4>
<PRE><A name=n1></A>template &lt;class BidirectionalIterator, class Allocator&gt;
bool operator == (const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m1,
const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m2);</PRE>
<P><B>Effects:</B> Compares the two sequences for equality.</P>
<PRE><A name=n2></A>template &lt;class BidirectionalIterator, class Allocator&gt;
bool operator != (const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m1,
const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m2);</PRE>
<P><B>Effects:</B> Compares the two sequences for inequality.</P>
<PRE><A name=n3></A>template &lt;class charT, class traits, class BidirectionalIterator, class Allocator&gt;
basic_ostream&lt;charT, traits&gt;&amp;
operator &lt;&lt; (basic_ostream&lt;charT, traits&gt;&amp; os,
const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m);</PRE>
<P><B>Effects:</B> Writes the contents of <EM>m</EM> to the stream <EM>os</EM> as
if by calling <code>os &lt;&lt; m.str();</code> Returns <EM>os</EM>..</P>
<PRE><A name=n4></A>template &lt;class BidirectionalIterator, class Allocator&gt;
void swap(match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m1,
match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m2);</PRE>
<P><B>Effects:</B> Swaps the contents of the two sequences.</P>
<p></p> <p></p>
<hr> <hr>
<p>Revised <p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan --> <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
17 May 2003 17 May 2003
<!--webbot bot="Timestamp" endspan i-checksum="39359" --></p> <!--webbot bot="Timestamp" endspan i-checksum="39359" --></p>
<p><i><EFBFBD> Copyright <a href="mailto:jm@regex.fsnet.co.uk">John Maddock</a>&nbsp;1998-
<p><i>&copy; Copyright <a href="mailto:jm@regex.fsnet.co.uk">John
Maddock</a>&nbsp;1998-
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan --> <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan -->
2003 2003
<!--webbot bot="Timestamp" endspan i-checksum="39359" --></i></p> <!--webbot bot="Timestamp" endspan i-checksum="39359" --></i></p>
<p align="left"><i>Permission to use, copy, modify, distribute and sell this software
<p align="left"><i>Permission to use, copy, modify, distribute and and its documentation for any purpose is hereby granted without fee, provided
sell this software and its documentation for any purpose is hereby that the above copyright notice appear in all copies and that both that
granted without fee, provided that the above copyright notice copyright notice and this permission notice appear in supporting documentation.
appear in all copies and that both that copyright notice and this Dr John Maddock makes no representations about the suitability of this software
permission notice appear in supporting documentation. Dr John for any purpose. It is provided "as is" without express or implied warranty.</i></p>
Maddock makes no representations about the suitability of this
software for any purpose. It is provided "as is" without express or
implied warranty.</i></p>
</body> </body>
</html> </html>

View File

@ -25,14 +25,15 @@
<HR> <HR>
<p></p> <p></p>
<P>If you are using Microsoft or Borland C++ and link to a dll version of the run <P>If you are using Microsoft or Borland C++ and link to a dll version of the run
time library, then you will also link to one of the dll versions of time library, then you can choose to also link to a dll version of boost.regex
boost.regex. While these dll's are redistributable, there are no "standard" by defining the symbol BOOST_REGEX_DYN_LINK when you compile your code. While
versions, so when installing on the users PC, you should place these in a these dll's are redistributable, there are no "standard" versions, so when
directory private to your application, and not in the PC's directory path. Note installing on the users PC, you should place these in a directory private to
that if you link to a static version of your run time library, then you will your application, and not in the PC's directory path. Note that if you link to
also link to a static version of boost.regex and no dll's will need to be a static version of your run time library, then you will also link to a static
distributed. The possible boost.regex dll and library names are computed version of boost.regex and no dll's will need to be distributed. The possible
according to the following formula:<BR> boost.regex dll and library names are computed according to the following
formula:<BR>
</P> </P>
<P></P> <P></P>
<P>BOOST_LIB_PREFIX<BR> <P>BOOST_LIB_PREFIX<BR>

View File

@ -42,40 +42,39 @@ template &lt;class BidirectionalIterator,
class regex_iterator class regex_iterator
{ {
public: public:
typedef basic_regex&lt;charT, traits, Allocator&gt; regex_type; typedef <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator&gt; regex_type;
typedef match_results&lt;BidirectionalIterator&gt; value_type; typedef <A href="match_results.html">match_results</A>&lt;BidirectionalIterator&gt; value_type;
typedef typename iterator_traits&lt;BidirectionalIterator&gt;::difference_type difference_type; typedef typename iterator_traits&lt;BidirectionalIterator&gt;::difference_type difference_type;
typedef const value_type* pointer; typedef const value_type* pointer;
typedef const value_type&amp; reference; typedef const value_type&amp; reference;
typedef std::forward_iterator_tag iterator_category; typedef std::forward_iterator_tag iterator_category;
regex_iterator(); <A href="#c1">regex_iterator</A>();
regex_iterator(BidirectionalIterator a, BidirectionalIterator b, <A href="#c2">regex_iterator</A>(BidirectionalIterator a, BidirectionalIterator b,
const regex_type&amp; re, const regex_type&amp; re,
match_flag_type m = match_default); <A href="match_flag_type.html">match_flag_type</A> m = match_default);
regex_iterator(const regex_iterator&amp;); <A href="#c3">regex_iterator</A>(const regex_iterator&amp;);
regex_iterator&amp; operator=(const regex_iterator&amp;); regex_iterator&amp; <A href="#o1">operator</A>=(const regex_iterator&amp;);
bool operator==(const regex_iterator&amp;); bool <A href="#o2">operator</A>==(const regex_iterator&amp;)const;
bool operator!=(const regex_iterator&amp;); bool <A href="#o3">operator</A>!=(const regex_iterator&amp;)const;
const value_type&amp; operator*(); const value_type&amp; <A href="#o4">operator</A>*()const;
const value_type* operator-&gt;(); const value_type* <A href="#o5">operator</A>-&gt;()const;
regex_iterator&amp; operator++(); regex_iterator&amp; <A href="#o6">operator</A>++();
regex_iterator operator++(int); regex_iterator <A href="#o7">operator</A>++(int);
}; };
</pre> </pre>
<h3><a name="description"></a>Description</h3> <h3><a name="description"></a>Description</h3>
<p>A regex_iterator is constructed from a pair of iterators, and enumerates all <p>A regex_iterator is constructed from a pair of iterators, and enumerates all
occurrences of a regular expression within that iterator range.</p> occurrences of a regular expression within that iterator range.</p>
<pre> <pre><A name=c1></A>
regex_iterator(); regex_iterator();
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> constructs an end of sequence regex_iterator.</p> <p><b>Effects:</b> constructs an end of sequence regex_iterator.</p>
<pre> <pre><A name=c2></A>regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
const regex_type&amp; re, const regex_type&amp; re,
match_flag_type m = match_default); <A href="match_flag_type.html">match_flag_type</A> m = match_default);
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> constructs a regex_iterator that will enumerate all occurrences <p><b>Effects:</b> constructs a regex_iterator that will enumerate all occurrences
@ -88,32 +87,32 @@ regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
Boost.regex is <A href="configuration.html">configured</A> in recursive mode), Boost.regex is <A href="configuration.html">configured</A> in recursive mode),
or if the matcher exhausts it's permitted memory allocation (if Boost.regex is <A href="configuration.html"> or if the matcher exhausts it's permitted memory allocation (if Boost.regex is <A href="configuration.html">
configured</A> in non-recursive mode).</P> configured</A> in non-recursive mode).</P>
<pre> <pre><A name=c3></A>
regex_iterator(const regex_iterator&amp; that); regex_iterator(const regex_iterator&amp; that);
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> constructs a copy of <code>that</code>.</p> <p><b>Effects:</b> constructs a copy of <code>that</code>.</p>
<b></b> <b></b>
<p><b>Postconditions:</b> <code>*this == that</code>.</p> <p><b>Postconditions:</b> <code>*this == that</code>.</p>
<pre> <pre><A name=o1></A>
regex_iterator&amp; operator=(const regex_iterator&amp;); regex_iterator&amp; operator=(const regex_iterator&amp;);
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> sets&nbsp;<code>*this</code> equal to those in <code>that</code>.</p> <p><b>Effects:</b> sets&nbsp;<code>*this</code> equal to those in <code>that</code>.</p>
<b></b> <b></b>
<p><b>Postconditions:</b> <code>*this == that</code>.</p> <p><b>Postconditions:</b> <code>*this == that</code>.</p>
<pre> <pre><A name=o2></A>
bool operator==(const regex_iterator&amp; that); bool operator==(const regex_iterator&amp; that)const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> returns true if *this is equal to that.</p> <p><b>Effects:</b> returns true if *this is equal to that.</p>
<pre> <pre><A name=o3></A>
bool operator!=(const regex_iterator&amp;); bool operator!=(const regex_iterator&amp;)const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> returns <code>!(*this == that)</code>.</p> <p><b>Effects:</b> returns <code>!(*this == that)</code>.</p>
<pre> <pre><A name=o4></A>
const value_type&amp; operator*(); const value_type&amp; operator*()const;
</pre> </pre>
<p><b>Effects:</b> dereferencing a regex_iterator object <em>it</em> yields a <p><b>Effects:</b> dereferencing a regex_iterator object <em>it</em> yields a
const reference to a <a href="match_results.html">match_results</a> object, const reference to a <a href="match_results.html">match_results</a> object,
@ -159,7 +158,8 @@ const value_type&amp; operator*();
<p>(*it).prefix().last</p> <p>(*it).prefix().last</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>(*it)[0].first</p> <p>The same as the start of the match found:<BR>
(*it)[0].first</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -167,7 +167,8 @@ const value_type&amp; operator*();
<p>(*it).prefix().matched</p> <p>(*it).prefix().matched</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>(*it).prefix().first != (*it).prefix().second</p> <p>True if the prefix did not match an empty string:<BR>
(*it).prefix().first != (*it).prefix().second</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -175,7 +176,8 @@ const value_type&amp; operator*();
<p>(*it).suffix().first</p> <p>(*it).suffix().first</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>(*it)[0].second</p> <p>The same as the end of the match found:<BR>
(*it)[0].second</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -191,7 +193,8 @@ const value_type&amp; operator*();
<p>(*it).suffix().matched</p> <p>(*it).suffix().matched</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>(*it).suffix().first != (*it).suffix().second</p> <p>True if the suffix did not match an empty string:<BR>
(*it).suffix().first != (*it).suffix().second</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -259,12 +262,12 @@ const value_type&amp; operator*();
</table> </table>
<br> <br>
<br> <br>
<pre> <pre><A name=o5></A>
const value_type* operator-&gt;(); const value_type* operator-&gt;()const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> returns <code>&amp;(*this)</code>.</p> <p><b>Effects:</b> returns <code>&amp;(*this)</code>.</p>
<pre> <pre><A name=o6></A>
regex_iterator&amp; operator++(); regex_iterator&amp; operator++();
</pre> </pre>
<p><strong>Effects:</strong> moves the iterator to the next match in the <p><strong>Effects:</strong> moves the iterator to the next match in the
@ -282,7 +285,7 @@ regex_iterator&amp; operator++();
configured</A> in non-recursive mode).</P> configured</A> in non-recursive mode).</P>
<b></b> <b></b>
<p><b>Returns:</b> <code>*this</code>.</p> <p><b>Returns:</b> <code>*this</code>.</p>
<pre> <pre><A name=o7></A>
regex_iterator operator++(int); regex_iterator operator++(int);
</pre> </pre>
<b></b> <b></b>

View File

@ -31,47 +31,53 @@
</dl> </dl>
<H3><A name="synopsis"></A>Synopsis</H3> <H3><A name="synopsis"></A>Synopsis</H3>
<PRE><A name=query_match></A>#include &lt;<A href="../../../boost/regex.hpp">boost/regex.hpp</A>&gt; </PRE> <PRE><A name=query_match></A>#include &lt;<A href="../../../boost/regex.hpp">boost/regex.hpp</A>&gt; </PRE>
<P>The algorithm regex _match determines whether a given regular expression <P>
matches a given sequence denoted by a pair of bidirectional-iterators, the The algorithm regex _match determines whether a given regular expression
algorithm is defined as follows, <STRONG>note that the result is true only if the matches all of a given character sequence denoted by a pair of
expression matches the whole of the input sequence</STRONG>, the main use of bidirectional-iterators, the algorithm is defined as follows, the main use of
this function is data input validation. this function is data input validation.
<P><STRONG>Note that the result is true only if the expression matches the whole of
the input sequence.&nbsp;</STRONG> If you want to search for an expression
somewhere within the sequence then use <A href="regex_search.html">regex_search</A>.&nbsp;
If you want to match a prefix of the character string then use <A href="regex_search.html">
regex_search</A> with the flag <A href="match_flag_type.html">match_continuous</A>
set.
<PRE>template &lt;class BidirectionalIterator, class Allocator, class charT, <PRE>template &lt;class BidirectionalIterator, class Allocator, class charT,
class traits, class Allocator2&gt; class traits, class Allocator2&gt;
bool regex_match(BidirectionalIterator first, BidirectionalIterator last, bool <A href="#f1">regex_match</A>(BidirectionalIterator first, BidirectionalIterator last,
<A href="match_results.html">match_results</A>&lt;BidirectionalIterator, Allocator&gt;&amp; m, <A href="match_results.html">match_results</A>&lt;BidirectionalIterator, Allocator&gt;&amp; m,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default); <A href="match_flag_type.html">match_flag_type</A> flags = match_default);
template &lt;class BidirectionalIterator, class charT, class traits, class Allocator2&gt; template &lt;class BidirectionalIterator, class charT, class traits, class Allocator2&gt;
bool regex_match(BidirectionalIterator first, BidirectionalIterator last, bool <A href="#f2">regex_match</A>(BidirectionalIterator first, BidirectionalIterator last,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default); <A href="match_flag_type.html">match_flag_type</A> flags = match_default);
template &lt;class charT, class Allocator, class traits, class Allocator2&gt; template &lt;class charT, class Allocator, class traits, class Allocator2&gt;
bool regex_match(const charT* str, <A href="match_results.html">match_results</A>&lt;const charT*, Allocator&gt;&amp; m, bool <A href="#f3">regex_match</A>(const charT* str, <A href="match_results.html">match_results</A>&lt;const charT*, Allocator&gt;&amp; m,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default); <A href="match_flag_type.html">match_flag_type</A> flags = match_default);
template &lt;class ST, class SA, class Allocator, class charT, template &lt;class ST, class SA, class Allocator, class charT,
class traits, class Allocator2&gt; class traits, class Allocator2&gt;
bool regex_match(const basic_string&lt;charT, ST, SA&gt;&amp; s, bool <A href="#f4">regex_match</A>(const basic_string&lt;charT, ST, SA&gt;&amp; s,
<A href="match_results.html">match_results</A>&lt;typename basic_string&lt;charT, ST, SA&gt;::const_iterator, Allocator&gt;&amp; m, <A href="match_results.html">match_results</A>&lt;typename basic_string&lt;charT, ST, SA&gt;::const_iterator, Allocator&gt;&amp; m,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default); <A href="match_flag_type.html">match_flag_type</A> flags = match_default);
template &lt;class charT, class traits, class Allocator2&gt; template &lt;class charT, class traits, class Allocator2&gt;
bool regex_match(const charT* str, bool <A href="#f5">regex_match</A>(const charT* str,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default); <A href="match_flag_type.html">match_flag_type</A> flags = match_default);
template &lt;class ST, class SA, class charT, class traits, class Allocator2&gt; template &lt;class ST, class SA, class charT, class traits, class Allocator2&gt;
bool regex_match(const basic_string&lt;charT, ST, SA&gt;&amp; s, bool <A href="#f6">regex_match</A>(const basic_string&lt;charT, ST, SA&gt;&amp; s,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default); <A href="match_flag_type.html">match_flag_type</A> flags = match_default);
</PRE> </PRE>
<H3><A name="description"></A>Description</H3> <H3><A name="description"></A>Description</H3>
<PRE>template &lt;class BidirectionalIterator, class Allocator, class charT, <PRE><A name=f1></A>template &lt;class BidirectionalIterator, class Allocator, class charT,
class traits, class Allocator2&gt; class traits, class Allocator2&gt;
bool regex_match(BidirectionalIterator first, BidirectionalIterator last, bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
<A href="match_results.html">match_results</A>&lt;BidirectionalIterator, Allocator&gt;&amp; m, <A href="match_results.html">match_results</A>&lt;BidirectionalIterator, Allocator&gt;&amp; m,
@ -84,9 +90,9 @@ bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
flags</I> is used to <A href="match_flag_type.html">control how the expression flags</I> is used to <A href="match_flag_type.html">control how the expression
is matched</A> against the character sequence. Returns true if such a match is matched</A> against the character sequence. Returns true if such a match
exists, false otherwise.</P> exists, false otherwise.</P>
<P><STRONG>Throws:</STRONG> <code>std::runtime_error</code> if the complexity of matching the <P><STRONG>Throws:</STRONG> <code>std::runtime_error</code> if the complexity of
expression against an N character string begins to exceed O(N<SUP>2</SUP>), or matching the expression against an N character string begins to exceed O(N<SUP>2</SUP>),
if the program runs out of stack space while matching the expression (if or if the program runs out of stack space while matching the expression (if
Boost.regex is <A href="configuration.html">configured</A> in recursive mode), Boost.regex is <A href="configuration.html">configured</A> in recursive mode),
or if the matcher exhausts it's permitted memory allocation (if Boost.regex is <A href="configuration.html"> or if the matcher exhausts it's permitted memory allocation (if Boost.regex is <A href="configuration.html">
configured</A> in non-recursive mode).</P> configured</A> in non-recursive mode).</P>
@ -231,20 +237,20 @@ bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
<P></P> <P></P>
<DIV></DIV> <DIV></DIV>
<PRE>&nbsp;</PRE> <PRE>&nbsp;</PRE>
<PRE>template &lt;class BidirectionalIterator, class charT, class traits, class Allocator2&gt; <PRE><A name=f2></A>template &lt;class BidirectionalIterator, class charT, class traits, class Allocator2&gt;
bool regex_match(BidirectionalIterator first, BidirectionalIterator last, bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE> <A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE>
<P><B> Effects:</B> Behaves "as if" by constructing an instance of <CODE><A href="match_results.html"> <P><B> Effects:</B> Behaves "as if" by constructing an instance of <CODE><A href="match_results.html">
match_results</A>&lt;</CODE>BidirectionalIterator<CODE>&gt; what</CODE>, match_results</A>&lt;</CODE>BidirectionalIterator<CODE>&gt; what</CODE>,
and then returning the result of <CODE>regex_match(first, last, what, e, flags)</CODE>.</P> and then returning the result of <CODE>regex_match(first, last, what, e, flags)</CODE>.</P>
<PRE>template &lt;class charT, class Allocator, class traits, class Allocator2&gt; <PRE><A name=f3></A>template &lt;class charT, class Allocator, class traits, class Allocator2&gt;
bool regex_match(const charT* str, <A href="match_results.html">match_results</A>&lt;const charT*, Allocator&gt;&amp; m, bool regex_match(const charT* str, <A href="match_results.html">match_results</A>&lt;const charT*, Allocator&gt;&amp; m,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE> <A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE>
<P><B> Effects:</B> Returns the result of <CODE>regex_match(str, str + <P><B> Effects:</B> Returns the result of <CODE>regex_match(str, str +
char_traits&lt;charT&gt;::length(str), m, e, flags)</CODE>.</P> char_traits&lt;charT&gt;::length(str), m, e, flags)</CODE>.</P>
<PRE>template &lt;class ST, class SA, class Allocator, class charT, <PRE><A name=f4></A>template &lt;class ST, class SA, class Allocator, class charT,
class traits, class Allocator2&gt; class traits, class Allocator2&gt;
bool regex_match(const basic_string&lt;charT, ST, SA&gt;&amp; s, bool regex_match(const basic_string&lt;charT, ST, SA&gt;&amp; s,
<A href="match_results.html">match_results</A>&lt;typename basic_string&lt;charT, ST, SA&gt;::const_iterator, Allocator&gt;&amp; m, <A href="match_results.html">match_results</A>&lt;typename basic_string&lt;charT, ST, SA&gt;::const_iterator, Allocator&gt;&amp; m,
@ -252,13 +258,13 @@ bool regex_match(const basic_string&lt;charT, ST, SA&gt;&amp; s,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE> <A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE>
<P><B> Effects:</B> Returns the result of <CODE>regex_match(s.begin(), s.end(), m, e, <P><B> Effects:</B> Returns the result of <CODE>regex_match(s.begin(), s.end(), m, e,
flags)</CODE>.</P> flags)</CODE>.</P>
<PRE>template &lt;class charT, class traits, class Allocator2&gt; <PRE><A name=f5></A>template &lt;class charT, class traits, class Allocator2&gt;
bool regex_match(const charT* str, bool regex_match(const charT* str,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE> <A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE>
<P><B> Effects:</B> Returns the result of <CODE>regex_match(str, str + <P><B> Effects:</B> Returns the result of <CODE>regex_match(str, str +
char_traits&lt;charT&gt;::length(str), e, flags)</CODE>.</P> char_traits&lt;charT&gt;::length(str), e, flags)</CODE>.</P>
<PRE>template &lt;class ST, class SA, class charT, class traits, class Allocator2&gt; <PRE><A name=f6></A>template &lt;class ST, class SA, class charT, class traits, class Allocator2&gt;
bool regex_match(const basic_string&lt;charT, ST, SA&gt;&amp; s, bool regex_match(const basic_string&lt;charT, ST, SA&gt;&amp; s,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE> <A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE>

View File

@ -29,7 +29,7 @@
<H3><A name="synopsis"></A>Synopsis</H3> <H3><A name="synopsis"></A>Synopsis</H3>
<PRE>#include &lt;<A href="../../../boost/regex.hpp">boost/regex.hpp</A>&gt; </PRE> <PRE>#include &lt;<A href="../../../boost/regex.hpp">boost/regex.hpp</A>&gt; </PRE>
<P>The algorithm regex_replace&nbsp;searches&nbsp;through&nbsp;a string finding <P>The algorithm regex_replace&nbsp;searches&nbsp;through&nbsp;a string finding
all the matches to the regular expression: for each match it then calls <A href="match_results.html"> all the matches to the regular expression: for each match it then calls <A href="match_results.html#format">
match_results::format</A> to format the string and sends the result to the match_results::format</A> to format the string and sends the result to the
output iterator. Sections of text that do not match are copied to the output output iterator. Sections of text that do not match are copied to the output
unchanged only if the <EM>flags</EM> parameter does not have the flag <A href="match_flag_type.html"> unchanged only if the <EM>flags</EM> parameter does not have the flag <A href="match_flag_type.html">
@ -37,39 +37,87 @@
is set then only the first occurrence is replaced rather than all is set then only the first occurrence is replaced rather than all
occurrences.&nbsp;<PRE>template &lt;class OutputIterator, class BidirectionalIterator, class traits, occurrences.&nbsp;<PRE>template &lt;class OutputIterator, class BidirectionalIterator, class traits,
class Allocator, class charT&gt; class Allocator, class charT&gt;
OutputIterator regex_replace(OutputIterator out, OutputIterator <A href="#f1">regex_replace</A>(OutputIterator out,
BidirectionalIterator first, BidirectionalIterator first,
BidirectionalIterator last, BidirectionalIterator last,
const basic_regex&lt;charT, traits, Allocator&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator&gt;&amp; e,
const basic_string&lt;charT&gt;&amp; fmt, const basic_string&lt;charT&gt;&amp; fmt,
match_flag_type flags = match_default); <A href="match_flag_type.html">match_flag_type flags = match_default</A>);
template &lt;class traits, class Allocator, class charT&gt; template &lt;class traits, class Allocator, class charT&gt;
basic_string&lt;charT&gt; regex_replace(const basic_string&lt;charT&gt;&amp; s, basic_string&lt;charT&gt; <A href="#f2">regex_replace</A>(const basic_string&lt;charT&gt;&amp; s,
const basic_regex&lt;charT, traits, Allocator&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator&gt;&amp; e,
const basic_string&lt;charT&gt;&amp; fmt, const basic_string&lt;charT&gt;&amp; fmt,
match_flag_type flags = match_default); <A href="match_flag_type.html">match_flag_type flags = match_default</A>);
</PRE> </PRE>
<H3><A name="description"></A>Description</H3> <H3><A name="description"></A>Description</H3>
<PRE>template &lt;class OutputIterator, class BidirectionalIterator, class traits, <PRE><A name=f1></A>template &lt;class OutputIterator, class BidirectionalIterator, class traits,
class Allocator, class charT&gt; class Allocator, class charT&gt;
OutputIterator regex_replace(OutputIterator out, OutputIterator regex_replace(OutputIterator out,
BidirectionalIterator first, BidirectionalIterator first,
BidirectionalIterator last, BidirectionalIterator last,
const basic_regex&lt;charT, traits, Allocator&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator&gt;&amp; e,
const basic_string&lt;charT&gt;&amp; fmt, const basic_string&lt;charT&gt;&amp; fmt,
match_flag_type flags = match_default);</PRE> <A href="match_flag_type.html">match_flag_type flags = match_default</A>);</PRE>
<P><B> Effects:</B> Finds all the non-overlapping matches <I>m</I> of type <CODE>match_results&lt;BidirectionalIterator&gt; <P>Enumerates all the occurences of expression <EM>e</EM> in the sequence [first,
</CODE>that occur within the sequence [first, last). If no such matches are last), replacing each occurence with the string that results by merging the
found and <CODE>!(flags &amp; format_no_copy)</CODE> then calls <CODE>std::copy(first, match found with the format string <EM>fmt</EM>, and copies the resulting
last, out)</CODE>. Otherwise, for each match found, if <CODE>!(flags &amp; string to <EM>out</EM>.&nbsp;</P>
format_no_copy)</CODE> calls <CODE>std::copy(m.prefix().first, m.prefix().last, <P>If the flag format_no_copy is set in <EM>flags</EM> then unmatched sections of
out)</CODE>, and then calls <CODE>m.format(out, fmt, flags)</CODE>. Finally text are not copied to output.&nbsp;
if <CODE>!(flags &amp; format_no_copy)</CODE> calls <CODE>std::copy(last_m.suffix().first, </P>
last_m,suffix().last, out) </CODE>where <CODE>last_m</CODE> is a copy of the <P>If the flag format_first_only is set in <EM>flags</EM> then only the first
last match found. If <CODE>flags &amp; format_first_only</CODE> is non-zero occurence of <EM>e</EM> is replaced.&nbsp;
then only the first match found is replaced.</P> </P>
<P>The manner in which the format string <EM>fmt</EM> is interpretted, along with
the rules used&nbsp;for finding matches,&nbsp;are determined by the <A href="match_flag_type.html">
flags</A> set in <EM>flags</EM></P>
<P><B>Effects:</B> Constructs an
<SPAN class="spelle">regex_iterator</SPAN>
object:
</P>
<PRE><SPAN style="FONT-SIZE: 10pt">regex_iterator&lt;</SPAN><SPAN class=spelle><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">BidirectionalIterator</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt">, </SPAN><SPAN class=spelle><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">charT</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt">, traits, Allocator&gt; <BR> </SPAN><SPAN class=grame><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">i(</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt">first, last, e, flags)</SPAN>, </PRE>
<P>and uses
<SPAN class="spelle">
<I>i</I></SPAN>
to enumerate through all of the matches <I>m</I> of type
<SPAN class="spelle">
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">match_results</SPAN>
</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&lt;<SPAN class="spelle">BidirectionalIterator</SPAN>&gt; </SPAN>that
occur within the sequence [first, last).
</P>
<P>If no such matches are found
<SPAN class="grame">and </SPAN></P>
<PRE><SPAN class=grame></SPAN><SPAN class=grame><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">!</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">(flags &amp; <SPAN class=spelle>format_no_copy</SPAN>)</SPAN> </PRE>
<P>then calls
</P>
<PRE><SPAN class=spelle><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">std::copy</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">(first, last, out)</SPAN>. </PRE>
<P>Otherwise, for each match found,
<SPAN class="grame">if </SPAN></P>
<PRE><SPAN class=grame></SPAN><SPAN class=grame><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">!</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">(flags &amp; <SPAN class=spelle>format_no_copy</SPAN>)</SPAN> </PRE>
<P>calls
</P>
<PRE><SPAN class=spelle><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">std::copy</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">(<SPAN class=spelle>m.prefix</SPAN>().first, <SPAN class=spelle>m.prefix</SPAN>().last, out)</SPAN>, </PRE>
<P>and then calls
</P>
<PRE><SPAN class=spelle><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">m.format</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">(out, <SPAN class=spelle>fmt</SPAN>, flags)</SPAN>. </PRE>
<P>Finally
<SPAN class="grame">if </SPAN></P>
<PRE><SPAN class=grame></SPAN><SPAN class=grame><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">!</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">(flags &amp; <SPAN class=spelle>format_no_copy</SPAN>)</SPAN> </PRE>
<P>calls
</P>
<PRE><SPAN class=spelle><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">std::copy</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">(<SPAN class=spelle>last_m.suffix</SPAN>().first, <SPAN class=spelle>last_m,suffix</SPAN>().last, out) </SPAN></PRE>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"></SPAN>where
<SPAN class="spelle">
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">last_m</SPAN>
</SPAN>
is a copy of the last match found.
</P>
<P>If
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">flags &amp;
<SPAN class="spelle">format_first_only</SPAN></SPAN>
is non-zero then only the first match found is replaced.</P>
<P><STRONG>Throws:</STRONG> <CODE>std::runtime_error</CODE> if the complexity of <P><STRONG>Throws:</STRONG> <CODE>std::runtime_error</CODE> if the complexity of
matching the expression against an N character string begins to exceed O(N<SUP>2</SUP>), matching the expression against an N character string begins to exceed O(N<SUP>2</SUP>),
or if the program runs out of stack space while matching the expression (if or if the program runs out of stack space while matching the expression (if
@ -78,11 +126,11 @@ OutputIterator regex_replace(OutputIterator out,
configured</A> in non-recursive mode).</P> configured</A> in non-recursive mode).</P>
<P><B> Returns:</B> <CODE>out</CODE>. <P><B> Returns:</B> <CODE>out</CODE>.
</P> </P>
<PRE>template &lt;class traits, class Allocator, class charT&gt; <PRE><A name=f2></A>template &lt;class traits, class Allocator, class charT&gt;
basic_string&lt;charT&gt; regex_replace(const basic_string&lt;charT&gt;&amp; s, basic_string&lt;charT&gt; regex_replace(const basic_string&lt;charT&gt;&amp; s,
const basic_regex&lt;charT, traits, Allocator&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator&gt;&amp; e,
const basic_string&lt;charT&gt;&amp; fmt, const basic_string&lt;charT&gt;&amp; fmt,
match_flag_type flags = match_default);</PRE> <A href="match_flag_type.html">match_flag_type flags = match_default</A>);</PRE>
<P><B> Effects:</B> Constructs an object <CODE>basic_string&lt;charT&gt; result</CODE>, <P><B> Effects:</B> Constructs an object <CODE>basic_string&lt;charT&gt; result</CODE>,
calls <CODE>regex_replace(back_inserter(result), s.begin(), s.end(), e, fmt, calls <CODE>regex_replace(back_inserter(result), s.begin(), s.end(), e, fmt,
flags)</CODE>, and then returns <CODE>result</CODE>. flags)</CODE>, and then returns <CODE>result</CODE>.

View File

@ -37,7 +37,7 @@
<PRE>template &lt;class BidirectionalIterator, <PRE>template &lt;class BidirectionalIterator,
class Allocator, class charT, class Allocator, class charT,
class traits, class Allocator2&gt; class traits, class Allocator2&gt;
bool regex_search(BidirectionalIterator first, BidirectionalIterator last, bool <A href="#f1">regex_search</A>(BidirectionalIterator first, BidirectionalIterator last,
<a href="match_results.html">match_results</a>&lt;BidirectionalIterator, Allocator&gt;&amp; m, <a href="match_results.html">match_results</a>&lt;BidirectionalIterator, Allocator&gt;&amp; m,
const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator2&gt;&amp; e, const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator2&gt;&amp; e,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default); <a href="match_flag_type.html">match_flag_type</a> flags = match_default);
@ -45,7 +45,7 @@ bool regex_search(BidirectionalIterator first, BidirectionalIterator last,
template &lt;class ST, class SA, template &lt;class ST, class SA,
class Allocator, class charT, class Allocator, class charT,
class traits, class Allocator2&gt; class traits, class Allocator2&gt;
bool regex_search(const basic_string&lt;charT, ST, SA&gt;&amp; s, bool <A href="#f2">regex_search</A>(const basic_string&lt;charT, ST, SA&gt;&amp; s,
<a href="match_results.html">match_results</a>&lt; <a href="match_results.html">match_results</a>&lt;
typename basic_string&lt;charT, ST,SA&gt;::const_iterator, typename basic_string&lt;charT, ST,SA&gt;::const_iterator,
Allocator&gt;&amp; m, Allocator&gt;&amp; m,
@ -54,32 +54,32 @@ bool regex_search(const basic_string&lt;charT, ST, SA&gt;&amp; s,
template&lt;class charT, class Allocator, class traits, template&lt;class charT, class Allocator, class traits,
class Allocator2&gt; class Allocator2&gt;
bool regex_search(const charT* str, bool <A href="#f3">regex_search</A>(const charT* str,
<a href="match_results.html">match_results</a>&lt;const charT*, Allocator&gt;&amp; m, <a href="match_results.html">match_results</a>&lt;const charT*, Allocator&gt;&amp; m,
const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator2&gt;&amp; e, const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator2&gt;&amp; e,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default); <a href="match_flag_type.html">match_flag_type</a> flags = match_default);
template &lt;class BidirectionalIterator, class Allocator, template &lt;class BidirectionalIterator, class Allocator,
class charT, class traits&gt; class charT, class traits&gt;
bool regex_search(BidirectionalIterator first, BidirectionalIterator last, bool <A href="#f4">regex_search</A>(BidirectionalIterator first, BidirectionalIterator last,
const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e, const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default); <a href="match_flag_type.html">match_flag_type</a> flags = match_default);
template &lt;class charT, class Allocator, template &lt;class charT, class Allocator,
class traits&gt; class traits&gt;
bool regex_search(const charT* str, bool <A href="#f5">regex_search</A>(const charT* str,
const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e, const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default); <a href="match_flag_type.html">match_flag_type</a> flags = match_default);
template&lt;class ST, class SA, template&lt;class ST, class SA,
class Allocator, class charT, class Allocator, class charT,
class traits&gt; class traits&gt;
bool regex_search(const basic_string&lt;charT, ST, SA&gt;&amp; s, bool <A href="#f6">regex_search</A>(const basic_string&lt;charT, ST, SA&gt;&amp; s,
const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e, const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default); <a href="match_flag_type.html">match_flag_type</a> flags = match_default);
</PRE> </PRE>
<H3><A name="description"></A>Description</H3> <H3><A name="description"></A>Description</H3>
<PRE>template &lt;class BidirectionalIterator, class Allocator, class charT, <PRE><A name=f1></A>template &lt;class BidirectionalIterator, class Allocator, class charT,
class traits, class Allocator2&gt; class traits, class Allocator2&gt;
bool regex_search(BidirectionalIterator first, BidirectionalIterator last, bool regex_search(BidirectionalIterator first, BidirectionalIterator last,
<a href="match_results.html">match_results</a>&lt;BidirectionalIterator, Allocator&gt;&amp; m, <a href="match_results.html">match_results</a>&lt;BidirectionalIterator, Allocator&gt;&amp; m,
@ -234,13 +234,13 @@ bool regex_search(BidirectionalIterator first, BidirectionalIterator last,
</TD></TR></TABLE> </TD></TR></TABLE>
</CENTER> </CENTER>
</DIV> </DIV>
<PRE>template &lt;class charT, class Allocator, class traits, class Allocator2&gt; <PRE><A name=f2></A>template &lt;class charT, class Allocator, class traits, class Allocator2&gt;
bool regex_search(const charT* str, <a href="match_results.html">match_results</a>&lt;const charT*, Allocator&gt;&amp; m, bool regex_search(const charT* str, <a href="match_results.html">match_results</a>&lt;const charT*, Allocator&gt;&amp; m,
const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator2&gt;&amp; e, const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator2&gt;&amp; e,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default);</PRE> <a href="match_flag_type.html">match_flag_type</a> flags = match_default);</PRE>
<P><B> Effects:</B> Returns the result of <CODE>regex_search(str, str + <P><B> Effects:</B> Returns the result of <CODE>regex_search(str, str +
char_traits&lt;charT&gt;::length(str), m, e, flags)</CODE>.</P> char_traits&lt;charT&gt;::length(str), m, e, flags)</CODE>.</P>
<PRE>template &lt;class ST, class SA, class Allocator, class charT, <PRE><A name=f3></A>template &lt;class ST, class SA, class Allocator, class charT,
class traits, class Allocator2&gt; class traits, class Allocator2&gt;
bool regex_search(const basic_string&lt;charT, ST, SA&gt;&amp; s, bool regex_search(const basic_string&lt;charT, ST, SA&gt;&amp; s,
<a href="match_results.html">match_results</a>&lt;typename basic_string&lt;charT, ST, SA&gt;::const_iterator, Allocator&gt;&amp; m, <a href="match_results.html">match_results</a>&lt;typename basic_string&lt;charT, ST, SA&gt;::const_iterator, Allocator&gt;&amp; m,
@ -248,7 +248,7 @@ bool regex_search(const basic_string&lt;charT, ST, SA&gt;&amp; s,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default);</PRE> <a href="match_flag_type.html">match_flag_type</a> flags = match_default);</PRE>
<P><B> Effects:</B> Returns the result of <CODE>regex_search(s.begin(), s.end(), m, <P><B> Effects:</B> Returns the result of <CODE>regex_search(s.begin(), s.end(), m,
e, flags)</CODE>.</P> e, flags)</CODE>.</P>
<PRE>template &lt;class iterator, class Allocator, class charT, <PRE><A name=f4></A>template &lt;class iterator, class Allocator, class charT,
class traits&gt; class traits&gt;
bool regex_search(iterator first, iterator last, bool regex_search(iterator first, iterator last,
const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e, const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e,
@ -256,13 +256,13 @@ bool regex_search(iterator first, iterator last,
<P><B> Effects:</B> Behaves "as if" by constructing an instance of <CODE><a href="match_results.html"> <P><B> Effects:</B> Behaves "as if" by constructing an instance of <CODE><a href="match_results.html">
match_results</a>&lt;</CODE>BidirectionalIterator<CODE>&gt; what</CODE>, match_results</a>&lt;</CODE>BidirectionalIterator<CODE>&gt; what</CODE>,
and then returning the result of <CODE>regex_search(first, last, what, e, flags)</CODE>.</P> and then returning the result of <CODE>regex_search(first, last, what, e, flags)</CODE>.</P>
<PRE>template &lt;class charT, class Allocator, class traits&gt; <PRE><A name=f5></A>template &lt;class charT, class Allocator, class traits&gt;
bool regex_search(const charT* str bool regex_search(const charT* str
const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e, const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default);</PRE> <a href="match_flag_type.html">match_flag_type</a> flags = match_default);</PRE>
<P><B> Effects:</B> Returns the result of <CODE>regex_search(str, str + <P><B> Effects:</B> Returns the result of <CODE>regex_search(str, str +
char_traits&lt;charT&gt;::length(str), e, flags)</CODE>.</P> char_traits&lt;charT&gt;::length(str), e, flags)</CODE>.</P>
<PRE>template &lt;class ST, class SA, class Allocator, class charT, <PRE><A name=f6></A>template &lt;class ST, class SA, class Allocator, class charT,
class traits&gt; class traits&gt;
bool regex_search(const basic_string&lt;charT, ST, SA&gt;&amp; s, bool regex_search(const basic_string&lt;charT, ST, SA&gt;&amp; s,
const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e, const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e,

View File

@ -45,35 +45,35 @@ template &lt;class BidirectionalIterator,
class regex_token_iterator class regex_token_iterator
{ {
public: public:
typedef basic_regex&lt;charT, traits, Allocator&gt; regex_type; typedef <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator&gt; regex_type;
typedef basic_string&lt;charT&gt; value_type; typedef basic_string&lt;charT&gt; value_type;
typedef typename iterator_traits&lt;BidirectionalIterator&gt;::difference_type difference_type; typedef typename iterator_traits&lt;BidirectionalIterator&gt;::difference_type difference_type;
typedef const value_type* pointer; typedef const value_type* pointer;
typedef const value_type&amp; reference; typedef const value_type&amp; reference;
typedef std::forward_iterator_tag iterator_category; typedef std::forward_iterator_tag iterator_category;
regex_token_iterator(); <A href="#c1">regex_token_iterator</A>();
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re, <A href="#c2">regex_token_iterator</A>(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re,
int submatch = 0, match_flag_type m = match_default); int submatch = 0, <A href="match_flag_type.html">match_flag_type</A> m = match_default);
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re, <A href="#c3">regex_token_iterator</A>(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re,
const std::vector&lt;int&gt;&amp; submatches, match_flag_type m = match_default); const std::vector&lt;int&gt;&amp; submatches, match_flag_type m = match_default);
template &lt;std::size_t N&gt; template &lt;std::size_t N&gt;
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re, <A href="#c4">regex_token_iterator</A>(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re,
const int (&amp;submatches)[N], match_flag_type m = match_default); const int (&amp;submatches)[N], match_flag_type m = match_default);
regex_token_iterator(const regex_token_iterator&amp;); <A href="#c5">regex_token_iterator</A>(const regex_token_iterator&amp;);
regex_token_iterator&amp; operator=(const regex_token_iterator&amp;); regex_token_iterator&amp; <A href="#o1">operator</A>=(const regex_token_iterator&amp;);
bool operator==(const regex_token_iterator&amp;); bool <A href="#o2">operator</A>==(const regex_token_iterator&amp;)const;
bool operator!=(const regex_token_iterator&amp;); bool <A href="#o3">operator</A>!=(const regex_token_iterator&amp;)const;
const value_type&amp; operator*(); const value_type&amp; <A href="#o4">operator</A>*()const;
const value_type* operator-&gt;(); const value_type* <A href="#o5">operator</A>-&gt;()const;
regex_token_iterator&amp; operator++(); regex_token_iterator&amp; <A href="#o6">operator</A>++();
regex_token_iterator operator++(int); regex_token_iterator <A href="#o7">operator</A>++(int);
}; };
</PRE> </PRE>
<H3><A name="description"></A>Description</H3> <H3><A name="description"></A>Description</H3>
<PRE>regex_token_iterator();</PRE> <PRE><A name=c1></A>regex_token_iterator();</PRE>
<P><B> Effects:</B> constructs an end of sequence iterator.</P> <P><B> Effects:</B> constructs an end of sequence iterator.</P>
<PRE>regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re, <PRE><A name=c2></A>regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re,
int submatch = 0, match_flag_type m = match_default);</PRE> int submatch = 0, match_flag_type m = match_default);</PRE>
<P><B> Preconditions: </B><CODE>!re.empty()</CODE>.</P> <P><B> Preconditions: </B><CODE>!re.empty()</CODE>.</P>
<P><B> Effects:</B> constructs a regex_token_iterator that will enumerate one <P><B> Effects:</B> constructs a regex_token_iterator that will enumerate one
@ -88,7 +88,7 @@ public:
Boost.regex is <A href="configuration.html">configured</A> in recursive mode), Boost.regex is <A href="configuration.html">configured</A> in recursive mode),
or if the matcher exhausts it's permitted memory allocation (if Boost.regex is <A href="configuration.html"> or if the matcher exhausts it's permitted memory allocation (if Boost.regex is <A href="configuration.html">
configured</A> in non-recursive mode).</P> configured</A> in non-recursive mode).</P>
<PRE>regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re, <PRE><A name=c3></A>regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re,
const std::vector&lt;int&gt;&amp; submatches, match_flag_type m = match_default);</PRE> const std::vector&lt;int&gt;&amp; submatches, match_flag_type m = match_default);</PRE>
<P><B> Preconditions:</B> <CODE>submatches.size() &amp;&amp; !re.empty()</CODE>.</P> <P><B> Preconditions:</B> <CODE>submatches.size() &amp;&amp; !re.empty()</CODE>.</P>
<P><B> Effects:</B> constructs a regex_token_iterator that will enumerate <EM>submatches.size()</EM> <P><B> Effects:</B> constructs a regex_token_iterator that will enumerate <EM>submatches.size()</EM>
@ -106,7 +106,7 @@ public:
Boost.regex is <A href="configuration.html">configured</A> in recursive mode), Boost.regex is <A href="configuration.html">configured</A> in recursive mode),
or if the matcher exhausts it's permitted memory allocation (if Boost.regex is <A href="configuration.html"> or if the matcher exhausts it's permitted memory allocation (if Boost.regex is <A href="configuration.html">
configured</A> in non-recursive mode).</P> configured</A> in non-recursive mode).</P>
<PRE>template &lt;std::size_t N&gt; <PRE><A name=c4></A>template &lt;std::size_t N&gt;
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re, regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re,
const int (&amp;submatches)[R], match_flag_type m = match_default);</PRE> const int (&amp;submatches)[R], match_flag_type m = match_default);</PRE>
<P><B> Preconditions: </B><CODE>!re.empty()</CODE>.</P> <P><B> Preconditions: </B><CODE>!re.empty()</CODE>.</P>
@ -126,25 +126,25 @@ regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const reg
Boost.regex is <A href="configuration.html">configured</A> in recursive mode), Boost.regex is <A href="configuration.html">configured</A> in recursive mode),
or if the matcher exhausts it's permitted memory allocation (if Boost.regex is <A href="configuration.html"> or if the matcher exhausts it's permitted memory allocation (if Boost.regex is <A href="configuration.html">
configured</A> in non-recursive mode).</P> configured</A> in non-recursive mode).</P>
<PRE>regex_token_iterator(const regex_token_iterator&amp; that);</PRE> <PRE><A name=c5></A>regex_token_iterator(const regex_token_iterator&amp; that);</PRE>
<P><B> Effects: </B>constructs a copy of <CODE>that</CODE>.</P> <P><B> Effects: </B>constructs a copy of <CODE>that</CODE>.</P>
<P><B> Postconditions:</B> <CODE>*this == that</CODE>.</P> <P><B> Postconditions:</B> <CODE>*this == that</CODE>.</P>
<PRE>regex_token_iterator&amp; operator=(const regex_token_iterator&amp; that);</PRE> <PRE><A name=o1></A>regex_token_iterator&amp; operator=(const regex_token_iterator&amp; that);</PRE>
<P><B> Effects: </B>sets <CODE>*this</CODE> to be equal to&nbsp;<CODE>that</CODE>.</P> <P><B> Effects: </B>sets <CODE>*this</CODE> to be equal to&nbsp;<CODE>that</CODE>.</P>
<P><B> Postconditions:</B> <CODE>*this == that</CODE>.</P> <P><B> Postconditions:</B> <CODE>*this == that</CODE>.</P>
<PRE>bool operator==(const regex_token_iterator&amp;);</PRE> <PRE><A name=o2></A>bool operator==(const regex_token_iterator&amp;)const;</PRE>
<P> <P>
<B>Effects: </B>returns true if *this is the same position as that.</P> <B>Effects: </B>returns true if *this is the same position as that.</P>
<PRE>bool operator!=(const regex_token_iterator&amp;);</PRE> <PRE><A name=o3></A>bool operator!=(const regex_token_iterator&amp;)const;</PRE>
<P> <P>
<B>Effects: </B>returns <CODE>!(*this == that)</CODE>.</P> <B>Effects: </B>returns <CODE>!(*this == that)</CODE>.</P>
<PRE>const value_type&amp; operator*();</PRE> <PRE><A name=o4></A>const value_type&amp; operator*()const;</PRE>
<P> <P>
<B>Effects: </B>returns the current string being enumerated.</P> <B>Effects: </B>returns the current string being enumerated.</P>
<PRE>const value_type* operator-&gt;();</PRE> <PRE><A name=o5></A>const value_type* operator-&gt;()const;</PRE>
<P> <P>
<B>Effects: </B>returns <CODE>&amp;(*this)</CODE>.</P> <B>Effects: </B>returns <CODE>&amp;(*this)</CODE>.</P>
<PRE>regex_token_iterator&amp; operator++();</PRE> <PRE><A name=o6></A>regex_token_iterator&amp; operator++();</PRE>
<P> <P>
<B>Effects: </B>Moves on to the next string to be enumerated.</P> <B>Effects: </B>Moves on to the next string to be enumerated.</P>
<P><STRONG>Throws:</STRONG> <CODE>std::runtime_error</CODE> if the complexity of <P><STRONG>Throws:</STRONG> <CODE>std::runtime_error</CODE> if the complexity of
@ -155,7 +155,7 @@ regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const reg
configured</A> in non-recursive mode).</P> configured</A> in non-recursive mode).</P>
<B> <B>
<P> <P>
Returns:</B><CODE> *this</CODE>.</P><PRE>regex_token_iterator&amp; operator++(int);</PRE> Returns:</B><CODE> *this</CODE>.</P><PRE><A name=o7></A>regex_token_iterator&amp; operator++(int);</PRE>
<P><B> Effects:</B> constructs a copy <CODE>result</CODE> of <CODE>*this</CODE>, <P><B> Effects:</B> constructs a copy <CODE>result</CODE> of <CODE>*this</CODE>,
then calls <CODE>++(*this)</CODE>.</P> then calls <CODE>++(*this)</CODE>.</P>
<P><B> Returns:</B> <CODE>result</CODE>.<A name="examples"></A> <P><B> Returns:</B> <CODE>result</CODE>.<A name="examples"></A>

View File

@ -38,6 +38,9 @@
<P>Objects of type <EM>sub_match</EM> may only obtained by subscripting an object <P>Objects of type <EM>sub_match</EM> may only obtained by subscripting an object
of type <EM><A href="match_results.html">match_results</A></EM> of type <EM><A href="match_results.html">match_results</A></EM>
. .
<P>Objects of type <EM>sub_match</EM> may be compared to objects of type <EM>std::basic_string</EM>,
or <EM>const charT*</EM> or <EM>const charT</EM>
.
<P>When the marked sub-expression denoted by an object of type sub_match&lt;&gt; <P>When the marked sub-expression denoted by an object of type sub_match&lt;&gt;
participated in a regular expression match then member <CODE>matched</CODE> evaluates participated in a regular expression match then member <CODE>matched</CODE> evaluates
to true, and members <CODE>first</CODE> and <CODE>second</CODE> denote the to true, and members <CODE>first</CODE> and <CODE>second</CODE> denote the
@ -61,154 +64,197 @@ public:
typedef typename iterator_traits&lt;BidirectionalIterator&gt;::difference_type difference_type; typedef typename iterator_traits&lt;BidirectionalIterator&gt;::difference_type difference_type;
typedef BidirectionalIterator iterator; typedef BidirectionalIterator iterator;
bool matched; bool <A href="#m1">matched</A>;
difference_type length()const; difference_type <A href="#m2">length</A>()const;
operator basic_string&lt;value_type&gt;()const; operator <A href="#m3">basic_string</A>&lt;value_type&gt;()const;
basic_string&lt;value_type&gt; str()const; basic_string&lt;value_type&gt; <A href="#m4">str</A>()const;
int compare(const sub_match&amp; s)const; int <A href="#m5">compare</A>(const sub_match&amp; s)const;
int compare(const basic_string&lt;value_type&gt;&amp; s)const; int <A href="#m6">compare</A>(const basic_string&lt;value_type&gt;&amp; s)const;
int compare(const value_type* s)const; int <A href="#m7">compare</A>(const value_type* s)const;
}; };
//
// comparisons to another sub_match:
//
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o11">operator</A> == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o12">operator</A> != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o13">operator</A> &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o14">operator</A> &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o15">operator</A> &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o16">operator</A> &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
//
// comparisons to a basic_string:
//
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator == (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs, bool <A href="#o21">operator</A> == (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator != (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs, bool <A href="#o22">operator</A> != (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &lt; (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs, bool <A href="#o23">operator</A> &lt; (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &gt; (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs, bool <A href="#o24">operator</A> &gt; (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &gt;= (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs, bool <A href="#o25">operator</A> &gt;= (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &lt;= (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs, bool <A href="#o26">operator</A> &lt;= (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o31">operator</A> == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs); const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o32">operator</A> != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs); const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o33">operator</A> &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs); const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o34">operator</A> &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs); const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o35">operator</A> &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs); const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o36">operator</A> &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs); const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);
//
// comparisons to a pointer to a character array:
//
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator == (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool <A href="#o41">operator</A> == (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator != (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool <A href="#o42">operator</A> != (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &lt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool <A href="#o43">operator</A> &lt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &gt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool <A href="#o44">operator</A> &gt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool <A href="#o45">operator</A> &gt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool <A href="#o46">operator</A> &lt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o51">operator</A> == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o52">operator</A> != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o53">operator</A> &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o54">operator</A> &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o55">operator</A> &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o56">operator</A> &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs);
//
// comparisons to a single character:
//
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator == (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool <A href="#o61">operator</A> == (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator != (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool <A href="#o62">operator</A> != (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &lt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool <A href="#o63">operator</A> &lt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &gt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool <A href="#o64">operator</A> &gt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool <A href="#o65">operator</A> &gt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool <A href="#o66">operator</A> &lt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o71">operator</A> == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o72">operator</A> != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o73">operator</A> &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o74">operator</A> &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o75">operator</A> &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o76">operator</A> &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs);
//
// addition operators:
//
template &lt;class RandomAccessIterator, class traits, class Allocator&gt;
std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type, traits, Allocator&gt;
<A href="#o81">operator</A> + (const std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type, traits, Allocator&gt;&amp; s,
const sub_match&lt;RandomAccessIterator&gt;&amp; m);
template &lt;class RandomAccessIterator, class traits, class Allocator&gt;
std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type, traits, Allocator&gt;
<A href="#o82">operator</A> + (const sub_match&lt;RandomAccessIterator&gt;&amp; m,
const std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type, traits, Allocator&gt;&amp; s);
template &lt;class RandomAccessIterator&gt; std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type&gt;
<A href="#o83">operator</A> + (typename iterator_traits&lt;RandomAccessIterator&gt;::value_type const* s,
const sub_match&lt;RandomAccessIterator&gt;&amp; m);
template &lt;class RandomAccessIterator&gt; std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type&gt;
<A href="#o84">operator</A> + (const sub_match&lt;RandomAccessIterator&gt;&amp; m,
typename iterator_traits&lt;RandomAccessIterator&gt;::value_type const * s);
template &lt;class RandomAccessIterator&gt;
std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type&gt;
<A href="#o85">operator</A> + (typename iterator_traits&lt;RandomAccessIterator&gt;::value_type const&amp; s,
const sub_match&lt;RandomAccessIterator&gt;&amp; m);
template &lt;class RandomAccessIterator&gt;
std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type&gt;
<A href="#o86">operator</A> + (const sub_match&lt;RandomAccessIterator&gt;&amp; m,
typename iterator_traits&lt;RandomAccessIterator&gt;::value_type const&amp; s);
template &lt;class RandomAccessIterator&gt;
std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type&gt;
<A href="#o87">operator</A> + (const sub_match&lt;RandomAccessIterator&gt;&amp; m1,
const sub_match&lt;RandomAccessIterator&gt;&amp; m2);
//
// stream inserter:
//
template &lt;class charT, class traits, class BidirectionalIterator&gt; template &lt;class charT, class traits, class BidirectionalIterator&gt;
basic_ostream&lt;charT, traits&gt;&amp; basic_ostream&lt;charT, traits&gt;&amp;
operator &lt;&lt; (basic_ostream&lt;charT, traits&gt;&amp; os, <A href="#oi">operator</A> &lt;&lt; (basic_ostream&lt;charT, traits&gt;&amp; os,
const sub_match&lt;BidirectionalIterator&gt;&amp; m); const sub_match&lt;BidirectionalIterator&gt;&amp; m);
} // namespace boost</PRE> } // namespace boost</PRE>
@ -225,188 +271,278 @@ basic_ostream&lt;charT, traits&gt;&amp;
<P>An iterator denoting the position of the start of the match.</P> <P>An iterator denoting the position of the start of the match.</P>
<PRE>iterator second</PRE> <PRE>iterator second</PRE>
<P>An iterator denoting the position of the end of the match.</P> <P>An iterator denoting the position of the end of the match.</P>
<PRE>bool matched</PRE> <PRE><A name=m1></A>bool matched</PRE>
<P>A Boolean value denoting whether this sub-expression participated in the match.</P> <P>A Boolean value denoting whether this sub-expression participated in the match.</P>
<PRE>static difference_type length();</PRE> <PRE><A name=m2></A>static difference_type length();</PRE>
<P>
<P> <B> <B>Effects: </B>returns the length of this matched sub-expression, or 0 if this
Effects: </B>returns <CODE>(matched ? 0 : distance(first, second))</CODE>.</P><PRE>operator basic_string&lt;value_type&gt;()const;</PRE> sub-expression was not matched: <CODE>matched ? distance(first, second) : 0)</CODE>.</P>
<PRE><A name=m3></A>operator basic_string&lt;value_type&gt;()const;</PRE>
<P> <B> <P>
Effects: </B>returns <CODE>(matched ? basic_string&lt;value_type&gt;(first, <B>Effects: </B>converts *this into a string: returns <CODE>(matched ?
second) : basic_string&lt;value_type&gt;()).</P></CODE><PRE>basic_string&lt;value_type&gt; str()const;</PRE> basic_string&lt;value_type&gt;(first, second) :
basic_string&lt;value_type&gt;()).</P>
<P><B> </CODE><PRE><A name=m4></A>basic_string&lt;value_type&gt; str()const;</PRE>
Effects: </B>returns <CODE>(matched ? basic_string&lt;value_type&gt;(first, <P><B> Effects: </B>returns a string representation of *this:&nbsp; <CODE>(matched ?
second) : basic_string&lt;value_type&gt;())</CODE>.</P><PRE>int compare(const sub_match&amp; s)const;</PRE> basic_string&lt;value_type&gt;(first, second) :
basic_string&lt;value_type&gt;())</CODE>.</P>
<P> <B> <PRE><A name=m5></A>int compare(const sub_match&amp; s)const;</PRE>
Effects: </B>returns <CODE>str().compare(s.str())</CODE>.</P><PRE>int compare(const basic_string&lt;value_type&gt;&amp; s)const;</PRE> <P>
<B>Effects: </B>performs a lexical comparison to <EM>s</EM>: returns <CODE>str().compare(s.str())</CODE>.</P>
<P><B> <PRE><A name=m6></A>int compare(const basic_string&lt;value_type&gt;&amp; s)const;</PRE>
Effects: </B>returns <CODE>str().compare(s)</CODE>.</P><PRE>int compare(const value_type* s)const;</PRE> <P><B> Effects: </B>compares *this to the string s: returns <CODE>str().compare(s)</CODE>.</P>
<PRE><A name=m7></A>int compare(const value_type* s)const;</PRE>
<P> <B> <P>
Effects: </B>returns <CODE>str().compare(s)</CODE>.</P> <B>Effects:<B></B> </B>compares *this to the null-terminated string <EM>s</EM>:<B>&nbsp;</B>returns
<CODE>str().compare(s)</CODE>.</P>
<H4> <H4>
sub_match non-member operators</H4> sub_match non-member operators</H4>
<PRE>template &lt;class BidirectionalIterator&gt; <H5>Comparisons against self</H5>
<PRE><A name=o11></A>template &lt;class BidirectionalIterator&gt;
bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.compare(rhs) == 0</CODE>.</P>
Effects: </B>returns <CODE>lhs.compare(rhs) == 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o12></A>template &lt;class BidirectionalIterator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.compare(rhs) != 0</CODE>.</P>
Effects: </B>returns <CODE>lhs.compare(rhs) != 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o13></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.compare(rhs) &lt; 0</CODE>.</P>
Effects: </B>returns <CODE>lhs.compare(rhs) &lt; 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o14></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P><B> Effects: </B>returns <CODE>lhs.compare(rhs) &lt;= 0</CODE>.</P>
<P><B> <PRE><A name=o15></A>template &lt;class BidirectionalIterator&gt;
Effects: </B>returns <CODE>lhs.compare(rhs) &lt;= 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.compare(rhs) &gt;= 0</CODE>.</P>
Effects: </B>returns <CODE>lhs.compare(rhs) &gt;= 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o16></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.compare(rhs) &gt; 0</CODE>.</P>
Effects: </B>returns <CODE>lhs.compare(rhs) &gt; 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <H5>Comparisons with std::basic_string</H5>
<pre><A name=o21></A>
template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator == (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits,
Allocator&gt;&amp; lhs, const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
</pre>
<P><B>Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P>
<PRE><A name=o22></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator != (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P>
<PRE><A name=o23></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &lt; (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs&nbsp;&lt; rhs.str()</CODE>.</P>
<PRE><A name=o24></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &gt; (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs&nbsp;&gt; rhs.str()</CODE>.</P>
<PRE><A name=o25></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &gt;= (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs &gt;= rhs.str()</CODE>.</P>
<PRE><A name=o26></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &lt;= (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs &lt;= rhs.str()</CODE>.</P>
<PRE><A name=o31></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P>
<PRE><A name=o32></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P>
<PRE><A name=o33></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs.str()&nbsp;&lt; rhs</CODE>.</P>
<PRE><A name=o34></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs.str()&nbsp;&gt; rhs</CODE>.</P>
<PRE><A name=o35></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs.str() &gt;= rhs</CODE>.</P>
<PRE><A name=o36></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs.str() &lt;= rhs</CODE>.</P>
<H5>Comparisons with null-terminated strings</H5>
<PRE><A name=o41></A>template &lt;class BidirectionalIterator&gt;
bool operator == (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool operator == (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o42></A>template &lt;class BidirectionalIterator&gt;
bool operator != (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool operator != (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE></A><A name=o43></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool operator &lt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs &lt; rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs &lt; rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o44></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool operator &gt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs &gt; rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs &gt; rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o45></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool operator &gt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs &gt;= rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs &gt;= rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o46></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool operator &lt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs &lt;= rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs &lt;= rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o51></A>template &lt;class BidirectionalIterator&gt;
bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o52></A>template &lt;class BidirectionalIterator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o53></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() &lt; rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() &lt; rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o54></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() &gt; rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() &gt; rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o55></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() &gt;= rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() &gt;= rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o56></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() &lt;= rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() &lt;= rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <H5>Comparisons with a single character</H5>
<PRE><A name=o61></A>template &lt;class BidirectionalIterator&gt;
bool operator == (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool operator == (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o62></A>template &lt;class BidirectionalIterator&gt;
bool operator != (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool operator != (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o63></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool operator &lt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs &lt; rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs &lt; rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o64></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool operator &gt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs &gt; rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs &gt; rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o65></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool operator &gt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs &gt;= rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs &gt;= rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o66></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool operator &lt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs &lt;= rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs &lt;= rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o71></A>template &lt;class BidirectionalIterator&gt;
bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o72></A>template &lt;class BidirectionalIterator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o73></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() &lt; rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() &lt; rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o74></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() &gt; rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() &gt; rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o75></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() &gt;= rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() &gt;= rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o76></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() &lt;= rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() &lt;= rhs</CODE>.</P><PRE>template &lt;class charT, class traits, class BidirectionalIterator&gt; <h5>Addition operators</h5>
<P>The addition operators for sub_match allow you to add a sub_match to any type
to which you can add a std::string and obtain a new string as the result.</P>
<PRE><A name=o81></A>template &lt;class RandomAccessIterator, class traits, class Allocator&gt;
std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type, traits, Allocator&gt;
operator + (const std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type, traits, Allocator&gt;&amp; s,
const sub_match&lt;RandomAccessIterator&gt;&amp; m); </PRE>
<P><B>Effects: </B>returns <CODE>s + m.str()</CODE>.</P>
<PRE><A name=o82></A>template &lt;class RandomAccessIterator, class traits, class Allocator&gt;
std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type, traits, Allocator&gt;
operator + (const sub_match&lt;RandomAccessIterator&gt;&amp; m,
const std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type, traits, Allocator&gt;&amp; s); </PRE>
<P><B>Effects: </B>returns <CODE>m.str() + s</CODE>.</P>
<PRE><A name=o83></A>template &lt;class RandomAccessIterator&gt; std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type&gt;
operator + (typename iterator_traits&lt;RandomAccessIterator&gt;::value_type const* s,
const sub_match&lt;RandomAccessIterator&gt;&amp; m); </PRE>
<P><B>Effects: </B>returns <CODE>s + m.str()</CODE>.</P>
<PRE><A name=o84></A>template &lt;class RandomAccessIterator&gt; std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type&gt;
operator + (const sub_match&lt;RandomAccessIterator&gt;&amp; m,
typename iterator_traits&lt;RandomAccessIterator&gt;::value_type const * s);</PRE>
<P><B>Effects: </B>returns <CODE>m.str() + s</CODE>.</P>
<PRE><A name=o85></A>template &lt;class RandomAccessIterator&gt;
std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type&gt;
operator + (typename iterator_traits&lt;RandomAccessIterator&gt;::value_type const&amp; s,
const sub_match&lt;RandomAccessIterator&gt;&amp; m); </PRE>
<P><B>Effects: </B>returns <CODE>s + m.str()</CODE>.</P>
<PRE><A name=o86></A>template &lt;class RandomAccessIterator&gt;
std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type&gt;
operator + (const sub_match&lt;RandomAccessIterator&gt;&amp; m,
typename iterator_traits&lt;RandomAccessIterator&gt;::value_type const&amp; s); </PRE>
<P><B>Effects: </B>returns <CODE>m.str() + s</CODE>.</P>
<PRE><A name=o87></A>template &lt;class RandomAccessIterator&gt;
std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type&gt;
operator + (const sub_match&lt;RandomAccessIterator&gt;&amp; m1,
const sub_match&lt;RandomAccessIterator&gt;&amp; m2);</PRE>
<P><B>Effects: </B>returns&nbsp;<CODE>m1.str() + m2.str()</CODE>.</P>
<h5>Stream inserter</h5>
<PRE><A name=oi></A>template &lt;class charT, class traits, class BidirectionalIterator&gt;
basic_ostream&lt;charT, traits&gt;&amp; basic_ostream&lt;charT, traits&gt;&amp;
operator &lt;&lt; (basic_ostream&lt;charT, traits&gt;&amp; os operator &lt;&lt; (basic_ostream&lt;charT, traits&gt;&amp; os
const sub_match&lt;BidirectionalIterator&gt;&amp; m);</PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; m);</PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>(os &lt;&lt; m.str())</CODE>.
Effects: </B>returns <CODE>(os &lt;&lt; m.str())</CODE>.
<HR> <HR>
<p>Revised <p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan --> <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
@ -422,5 +558,3 @@ basic_ostream&lt;charT, traits&gt;&amp;
for any purpose. It is provided "as is" without express or implied warranty.</I></P> for any purpose. It is provided "as is" without express or implied warranty.</I></P>
</body> </body>
</html> </html>

View File

@ -23,6 +23,11 @@
</TABLE> </TABLE>
</P> </P>
<HR> <HR>
<P>The regex library is thread safe when Boost is: you can verify that Boost is in
thread safe mode by checking to see if BOOST_HAS_THREADS is defined: this macro
is set automatically by the config system when threading support is turned on
in your compiler.
</P>
<P>Class <A href="basic_regex.html">basic_regex</A>&lt;&gt; and its typedefs regex <P>Class <A href="basic_regex.html">basic_regex</A>&lt;&gt; and its typedefs regex
and wregex are thread safe, in that compiled regular expressions can safely be and wregex are thread safe, in that compiled regular expressions can safely be
shared between threads. The matching algorithms <A href="regex_match.html">regex_match</A>, shared between threads. The matching algorithms <A href="regex_match.html">regex_match</A>,
@ -65,4 +70,3 @@
for any purpose. It is provided "as is" without express or implied warranty.</I></P> for any purpose. It is provided "as is" without express or implied warranty.</I></P>
</body> </body>
</html> </html>

File diff suppressed because it is too large Load Diff

View File

@ -3,108 +3,83 @@
<head> <head>
<title>Boost.Regex: Contacts</title> <title>Boost.Regex: Contacts</title>
<meta name="generator" content="HTML Tidy, see www.w3.org"> <meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content= <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
"text/html; charset=iso-8859-1" >
<link rel="stylesheet" type="text/css" href="../../../boost.css"> <link rel="stylesheet" type="text/css" href="../../../boost.css">
</head> </head>
<body> <body>
<p></p> <p></p>
<table id="Table1" cellspacing="1" cellpadding="1" width="100%" border="0">
<table id="Table1" cellspacing="1" cellpadding="1" width="100%"
border="0">
<tr> <tr>
<td valign="top" width="300"> <td valign="top" width="300">
<h3><a href="../../../index.htm"><img height="86" width="277" alt= <h3><a href="../../../index.htm"><IMG height="86" alt="C++ Boost" src="../../../c++boost.gif" width="277" border="0"></a></h3>
"C++ Boost" src="../../../c++boost.gif" border=0></a></h3>
</td> </td>
<td width="353"> <td width="353">
<h1 align="center">Boost.Regex</h1> <h1 align="center">Boost.Regex</h1>
<h2 align="center">Contacts and Acknowledgements</h2> <h2 align="center">Contacts and Acknowledgements</h2>
</td> </td>
<td width="50"> <td width="50">
<h3><a href="index.html"><img height="45" width="43" alt= <h3><a href="index.html"><IMG height="45" alt="Boost.Regex Index" src="uarrow.gif" width="43" border="0"></a></h3>
"Boost.Regex Index" src="uarrow.gif" border=0></a></h3>
</td> </td>
</tr> </tr>
</table> </table>
<BR>
<br> <BR>
<br> <HR>
<P>The author can be contacted at <A href="mailto:john@johnmaddock.co.uk">john@johnmaddock.co.uk</A>;&nbsp;the
home page for this library is at <A href="http://www.boost.org">www.boost.org</A>.</P>
<hr> <P>I am indebted to Robert Sedgewick's "Algorithms in C++" for forcing me to think
<p>The author can be contacted at <a href="mailto:john_maddock@compuserve.com"> about algorithms and their performance, and to the folks at boost for forcing
john_maddock@compuserve.com</a>, the home page for this library is me to <I>think</I>, period. The following people have all contributed useful
at <a href="http://ourworld.compuserve.com/homepages/john_maddock/regexpp.htm"> comments or fixes: Dave Abrahams, Mike Allison, Edan Ayal, Jayashree
http://ourworld.compuserve.com/homepages/john_maddock/regexpp.htm</a>, Balasubramanian, Jan B<>lsche, Beman Dawes, Paul Baxter, David Bergman, David
and the official boost version can be obtained from <a href="../../libraries.htm">www.boost.org/libraries.htm</a>.</p> Dennerline, Edward Diener, Peter Dimov, Robert Dunn, Fabio Forno, Tobias
Gabrielsson, Rob Gillen, Marc Gregoire, Chris Hecker, Nick Hodapp, Jesse Jones,
<p>I am indebted to Robert Sedgewick's "Algorithms in C++" for Martin Jost, Boris Krasnovskiy, Jan Hermelink, Max Leung, Wei-hao Lin, Jens
forcing me to think about algorithms and their performance, and to Maurer, Richard Peters, Heiko Schmidt, Jason Shirk, Gerald Slacik, Scobie
the folks at boost for forcing me to <i>think</i>, period. The Smith, Mike Smyth, Alexander Sokolovsky, Herv<72> Poirier, Michael Raykh, Marc
following people have all contributed useful comments or fixes: Recht, Scott VanCamp, Bruno Voigt, Alexey Voinov, Jerry Waldorf, Rob Ward,
Dave Abrahams, Mike Allison, Edan Ayal, Jayashree Balasubramanian, Lealon Watts, Thomas Witt and Yuval Yosef. I am also grateful to the manuals
Jan B<>lsche, Beman Dawes, Paul Baxter, David Bergman, David supplied with the Henry Spencer, Perl and GNU regular expression libraries -
Dennerline, Edward Diener, Peter Dimov, Robert Dunn, Fabio Forno, wherever possible I have tried to maintain compatibility with these libraries
Tobias Gabrielsson, Rob Gillen, Marc Gregoire, Chris Hecker, Nick and with the POSIX standard - the code however is entirely my own, including
Hodapp, Jesse Jones, Martin Jost, Boris Krasnovskiy, Jan Hermelink, any bugs! I can absolutely guarantee that I will not fix any bugs I don't know
Max Leung, Wei-hao Lin, Jens Maurer, Richard Peters, Heiko Schmidt, about, so if you have any comments or spot any bugs, please get in touch.</P>
Jason Shirk, Gerald Slacik, Scobie Smith, Mike Smyth, Alexander <P>Useful further information can be found at:</P>
Sokolovsky, Herv<72> Poirier, Michael Raykh, Marc Recht, Scott <P>Short&nbsp;tutorials on regular expressions can be <A href="http://etext.lib.virginia.edu/helpsheets/regex.html">
VanCamp, Bruno Voigt, Alexey Voinov, Jerry Waldorf, Rob Ward, found here</A> and&nbsp;<A href="http://www.devshed.com/Server_Side/Administration/RegExp/page1.html">here</A>.</P>
Lealon Watts, Thomas Witt and Yuval Yosef. I am also grateful to <P>The main book on regular expressions is <A href="http://www.oreilly.com/catalog/regex/">
the manuals supplied with the Henry Spencer, Perl and GNU regular Mastering Regular Expressions, published by O'Reilly</A>.</P>
expression libraries - wherever possible I have tried to maintain <P>Information on the <A href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1429.htm">
compatibility with these libraries and with the POSIX standard - Boost.regex standardization proposal</A>, along with other <A href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1475.html">
the code however is entirely my own, including any bugs! I can standard library extension proposals</A> can be found on the <A href="http://anubis.dkuug.dk/jtc1/sc22/wg21/">
absolutely guarantee that I will not fix any bugs I don't know C++ Committees web pages</A>.</P>
about, so if you have any comments or spot any bugs, please get in <P>The<a href="http://www.opengroup.org/onlinepubs/7908799/toc.htm">Open Unix
touch.</p> Specification</a> contains a wealth of useful material, including the
regular expression syntax, and specifications for <a href="http://www.opengroup.org/onlinepubs/7908799/xsh/regex.h.html">
<p>Useful further information can be found at:</p>
<p>A short tutorial on regular expressions <a href="http://www.devshed.com/Server_Side/Administration/RegExp/">can be
found here</a>.</p>
<p>The <a href="http://www.opengroup.org/onlinepubs/7908799/toc.htm">Open Unix
Specification</a> contains a wealth of useful material, including
the regular expression syntax, and specifications for <a href="http://www.opengroup.org/onlinepubs/7908799/xsh/regex.h.html">
&lt;regex.h&gt;</a> and <a href="http://www.opengroup.org/onlinepubs/7908799/xsh/nl_types.h.html"> &lt;regex.h&gt;</a> and <a href="http://www.opengroup.org/onlinepubs/7908799/xsh/nl_types.h.html">
&lt;nl_types.h&gt;</a>.</p> &lt;nl_types.h&gt;</a>.</P>
<p>The <a href="http://www.cs.ucr.edu/~stelo/pattern.html">Pattern Matching Pointers</a>
<p>The <a href="http://www.cs.ucr.edu/~stelo/pattern.html">Pattern site is a "must visit" resource for anyone interested in pattern matching.</p>
Matching Pointers</a> site is a "must visit" resource for anyone <p><a href="http://glimpse.cs.arizona.edu/">Glimpse and Agrep</a>, use a
interested in pattern matching.</p> simplified regular expression syntax to achieve faster search times.</p>
<p><a href="http://glimpse.cs.arizona.edu/udi.html">Udi Manber</a> and <a href="http://www.dcc.uchile.cl/~rbaeza/">
<p><a href="http://glimpse.cs.arizona.edu/">Glimpse and Agrep</a>, Ricardo Baeza-Yates</a> both have a selection of useful pattern matching
use a simplified regular expression syntax to achieve faster search
times.</p>
<p><a href="http://glimpse.cs.arizona.edu/udi.html">Udi Manber</a>
and <a href="http://www.dcc.uchile.cl/~rbaeza/">Ricardo
Baeza-Yates</a> both have a selection of useful pattern matching
papers available from their respective web sites.</p> papers available from their respective web sites.</p>
<p></p> <p></p>
<hr> <hr>
<p>Revised <p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->17 May 2003 <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
17 May 2003
<!--webbot bot="Timestamp" endspan i-checksum="39359" --></p> <!--webbot bot="Timestamp" endspan i-checksum="39359" --></p>
<p><i><EFBFBD> Copyright <a href="mailto:jm@regex.fsnet.co.uk">John Maddock</a>&nbsp;1998-
<p><i><EFBFBD> Copyright <a href="mailto:jm@regex.fsnet.co.uk">John <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan -->
Maddock</a>&nbsp;1998- 2003
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan -->2003
<!--webbot bot="Timestamp" endspan i-checksum="39359" --></i></p> <!--webbot bot="Timestamp" endspan i-checksum="39359" --></i></p>
<p align="left"><i>Permission to use, copy, modify, distribute and sell this software
<p align="left"><i>Permission to use, copy, modify, distribute and and its documentation for any purpose is hereby granted without fee, provided
sell this software and its documentation for any purpose is hereby that the above copyright notice appear in all copies and that both that
granted without fee, provided that the above copyright notice copyright notice and this permission notice appear in supporting documentation.
appear in all copies and that both that copyright notice and this Dr John Maddock makes no representations about the suitability of this software
permission notice appear in supporting documentation. Dr John for any purpose. It is provided "as is" without express or implied warranty.</i></p>
Maddock makes no representations about the suitability of this
software for any purpose. It is provided "as is" without express or
implied warranty.</i></p>
</body> </body>
</html> </html>

View File

@ -28,16 +28,19 @@
<UL> <UL>
<LI> <LI>
Completely rewritten pattern matching code - it is now up to 10 times faster Completely rewritten pattern matching code - it is now up to 10 times faster
than before.</LI> than before.
<LI> <LI>
Reorganized documentation.</LI> Reorganized documentation.
<LI> <LI>
Deprecated all interfaces that are not part of the <A href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1429.htm"> Deprecated all interfaces that are not part of the <A href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1429.htm">
regular expression standardization proposal</A>.</LI> regular expression standardization proposal</A>.
<LI> <LI>
Added regex_iterator and regex_token_iterator.</LI> Added regex_iterator and regex_token_iterator.
<LI> <LI>
Added support for Perl style independent sub-expressions.</LI></UL> Added support for Perl style independent sub-expressions.
<LI>
Added non-member operators to the sub_match class, so that you can compare
sub_match's with strings, or add them to a string to produce a new string.</LI></UL>
<P> <P>
<HR> <HR>
<P></P> <P></P>
@ -55,4 +58,3 @@
for any purpose. It is provided "as is" without express or implied warranty.</I></P> for any purpose. It is provided "as is" without express or implied warranty.</I></P>
</body> </body>
</html> </html>

View File

@ -62,7 +62,7 @@
to be hard-coded to the C-locale, consequently this was not an issue for them). to be hard-coded to the C-locale, consequently this was not an issue for them).
That leaves us with the following regular expression to validate credit card That leaves us with the following regular expression to validate credit card
number formats:</P> number formats:</P>
<P>(\d{4}[- ]){3}\d{4}</P> <PRE>(\d{4}[- ]){3}\d{4}</PRE>
<P>Here the parenthesis act to group (and mark for future reference) <P>Here the parenthesis act to group (and mark for future reference)
sub-expressions, and the {4} means "repeat exactly 4 times". This is an example sub-expressions, and the {4} means "repeat exactly 4 times". This is an example
of the extended regular expression syntax used by Perl, awk and egrep. Regex++ of the extended regular expression syntax used by Perl, awk and egrep. Regex++
@ -93,8 +93,9 @@
need two strings - one a regular expression - the other a "<A href="format_syntax.html">format need two strings - one a regular expression - the other a "<A href="format_syntax.html">format
string</A>" that provides a description of the text to replace the match string</A>" that provides a description of the text to replace the match
with. In regex++ this search and replace operation is performed with the with. In regex++ this search and replace operation is performed with the
algorithm regex_replace, for our credit card example we can write two algorithms algorithm<A href="regex_replace.html"> regex_replace</A>, for our credit card
like this to provide the format conversions:</P> example we can write two algorithms like this to provide the format
conversions:</P>
<PRE><I>// match any format with the regular expression: <PRE><I>// match any format with the regular expression:
</I><B>const</B> boost::regex e("\\A(\\d{3,4})[- ]?(\\d{4})[- ]?(\\d{4})[- ]?(\\d{4})\\z"); </I><B>const</B> boost::regex e("\\A(\\d{3,4})[- ]?(\\d{4})[- ]?(\\d{4})[- ]?(\\d{4})\\z");
<B>const</B> std::string machine_format("\\1\\2\\3\\4"); <B>const</B> std::string machine_format("\\1\\2\\3\\4");
@ -126,22 +127,31 @@ std::string human_readable_card_number(<B>const</B> std::string s)
<STRONG>typedef</STRONG> match_results&lt;std::string::const_iterator&gt; smatch; <STRONG>typedef</STRONG> match_results&lt;std::string::const_iterator&gt; smatch;
<STRONG>typedef</STRONG> match_results&lt;std::wstring::const_iterator&gt; wsmatch; <STRONG>typedef</STRONG> match_results&lt;std::wstring::const_iterator&gt; wsmatch;
}</PRE> }</PRE>
<P>The algorithms <A href="regex_search.html">regex_search</A> and <A href="regex_grep.html"> <P>The algorithms <A href="regex_search.html">regex_search</A> and&nbsp;<A href="regex_match.html">regex_match</A>
regex_grep</A> (i.e. finding all matches in a string) make use of make use of match_results to report what matched; the difference between these
match_results to report what matched.</P> algorithms is that <A href="regex_match.html">regex_match</A> will only find
matches that consume <EM>all</EM> of the input text, where as <A href="regex_search.html">
regex_search</A> will <EM>search</EM> for a match anywhere within the text
being matched.</P>
<P>Note that these algorithms are not restricted to searching regular C-strings, <P>Note that these algorithms are not restricted to searching regular C-strings,
any bidirectional iterator type can be searched, allowing for the possibility any bidirectional iterator type can be searched, allowing for the possibility
of seamlessly searching almost any kind of data. of seamlessly searching almost any kind of data.
</P> </P>
<P>For search and replace operations in addition to the algorithm <A href="regex_replace.html"> <P>For search and replace operations, in addition to the algorithm <A href="regex_replace.html">
regex_replace</A> that we have already seen, the algorithm <A href="regex_format.html"> regex_replace</A> that we have already seen, the <A href="match_results.html">match_results</A>
regex_format</A> takes the result of a match and a format string, and class has a format member that takes the result of a match and a format string,
produces a new string by merging the two.</P> and produces a new string by merging the two.</P>
<P>For iterating through all occurences of an expression within a text, there are
two iterator types: <A href="regex_iterator.html">regex_iterator</A> will
enumerate over the <A href="match_results.html">match_results</A> objects
found, while <A href="regex_token_iterator.html">regex_token_iterator</A> will
enumerate a series of strings (similar to perl style split operations).</P>
<P>For those that dislike templates, there is a high level wrapper class RegEx <P>For those that dislike templates, there is a high level wrapper class RegEx
that is an encapsulation of the lower level template code - it provides a that is an encapsulation of the lower level template code - it provides a
simplified interface for those that don't need the full power of the library, simplified interface for those that don't need the full power of the library,
and supports only narrow characters, and the "extended" regular expression and supports only narrow characters, and the "extended" regular expression
syntax. syntax. This class is now deprecated as it does not form part of the regular
expressions C++ standard library proposal.
</P> </P>
<P>The <A href="posix_api.html">POSIX API</A> functions: regcomp, regexec, regfree <P>The <A href="posix_api.html">POSIX API</A> functions: regcomp, regexec, regfree
and regerror, are available in both narrow character and Unicode versions, and and regerror, are available in both narrow character and Unicode versions, and
@ -171,6 +181,3 @@ std::string human_readable_card_number(<B>const</B> std::string s)
for any purpose. It is provided "as is" without express or implied warranty.</I></P> for any purpose. It is provided "as is" without express or implied warranty.</I></P>
</body> </body>
</html> </html>

View File

@ -1,45 +1,35 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html> <html>
<head> <head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<title>Boost.Regex: match_flag_type</title> <title>Boost.Regex: match_flag_type</title>
<meta http-equiv="Content-Type" content= <meta name="generator" content="HTML Tidy, see www.w3.org">
"text/html; charset=iso-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../../boost.css"> <link rel="stylesheet" type="text/css" href="../../../boost.css">
</head> </head>
<body> <body>
<p></p> <p></p>
<table id="Table1" cellspacing="1" cellpadding="1" width="100%" border="0">
<table id="Table1" cellspacing="1" cellpadding="1" width="100%"
border="0">
<tr> <tr>
<td valign="top" width="300"> <td valign="top" width="300">
<h3><a href="../../../index.htm"><img height="86" width="277" alt= <h3><a href="../../../index.htm"><img height="86" width="277" alt="C++ Boost" src="../../../c++boost.gif" border="0"></a></h3>
"C++ Boost" src="../../../c++boost.gif" border="0"></a></h3>
</td> </td>
<td width="353"> <td width="353">
<h1 align="center">Boost.Regex</h1> <h1 align="center">Boost.Regex</h1>
<h2 align="center">match_flag_type</h2> <h2 align="center">match_flag_type</h2>
</td> </td>
<td width="50"> <td width="50">
<h3><a href="index.html"><img height="45" width="43" alt= <h3><a href="index.html"><img height="45" width="43" alt="Boost.Regex Index" src="uarrow.gif" border="0"></a></h3>
"Boost.Regex Index" src="uarrow.gif" border="0"></a></h3>
</td> </td>
</tr> </tr>
</table> </table>
<br> <br>
<br> <br>
<hr> <hr>
<h3>Synopsis</h3> <h3>Synopsis</h3>
<p>The type <code>match_flag_type</code> is an implementation defined bitmask type
<p>The type <code>match_flag_type</code> is an implementation (17.3.2.1.2) that controls how a regular expression is matched against a
defined bitmask type (17.3.2.1.2) that controls how a regular character sequence.&nbsp; The behavior of the format flags is descibed in more
expression is matched against a character sequence.</p> detail in the <A href="format_syntax.html">format syntax guide</A>.</p>
<pre> <pre>
namespace std{ namespace regex_constants{ namespace std{ namespace regex_constants{
@ -70,18 +60,13 @@ static const match_flag_type format_all;
} // namespace regex_constants } // namespace regex_constants
} // namespace std } // namespace std
</pre> </pre>
<h3>Description</h3> <h3>Description</h3>
<p>The type <code>match_flag_type</code> is an implementation defined bitmask type
<p>The type <code>match_flag_type</code> is an implementation (17.3.2.1.2). When matching a regular expression against a sequence of
defined bitmask type (17.3.2.1.2). When matching a regular characters [first, last) then setting its elements has the effects listed in
expression against a sequence of characters [first, last) then the table below:</p>
setting its elements has the effects listed in the table below:</p>
<p></p> <p></p>
<table id="Table2" cellspacing="1" cellpadding="7" width="100%" border="0">
<table id="Table2" cellspacing="1" cellpadding="7" width="100%"
border="0">
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Element</p> <p>Element</p>
@ -90,241 +75,198 @@ border="0">
<p>Effect if set</p> <p>Effect if set</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>match_default</p> <p>match_default</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that matching of regular expressions proceeds without <p>Specifies that matching of regular expressions proceeds without any
any modification of the normal rules used in ECMA-262, ECMAScript modification of the normal rules used in ECMA-262, ECMAScript Language
Language Specification, Chapter 15 part 10, RegExp (Regular Specification, Chapter 15 part 10, RegExp (Regular Expression) Objects (FWD.1)</p>
Expression) Objects (FWD.1)</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%">match_not_bob</td> <td valign="top" width="50%">match_not_bob</td>
<td valign="top" width="50%">Specifies that the expression "\A" <td valign="top" width="50%">Specifies that the expression "\A" should not match
should not match against the sub-sequence [first,first).</td> against the sub-sequence [first,first).</td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%">match_not_eob</td> <td valign="top" width="50%">match_not_eob</td>
<td valign="top" width="50%">Specifies that the expressions "\z" <td valign="top" width="50%">Specifies that the expressions "\z" and
and "\Z"&nbsp;should not match against the sub-sequence "\Z"&nbsp;should not match against the sub-sequence [last,last).</td>
[last,last).</td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>match_not_bol</p> <p>match_not_bol</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that the expression "^" should not be matched against <p>Specifies that the expression "^" should not be matched against the
the sub-sequence [first,first).</p> sub-sequence [first,first).</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>match_not_eol</p> <p>match_not_eol</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that the expression "$" should not be matched against <p>Specifies that the expression "$" should not be matched against the
the sub-sequence [last,last).</p> sub-sequence [last,last).</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>match_not_bow</p> <p>match_not_bow</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that the expression "\b" should not be matched against <p>Specifies that the expression "\b" should not be matched against the
the sub-sequence [first,first).</p> sub-sequence [first,first).</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>match_not_eow</p> <p>match_not_eow</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that the expression "\b" should not be matched against <p>Specifies that the expression "\b" should not be matched against the
the sub-sequence [last,last).</p> sub-sequence [last,last).</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>match_any</p> <p>match_any</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that if more than one match is possible then any match <p>Specifies that if more than one match is possible then any match is an
is an acceptable result.</p> acceptable result.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>match_not_null</p> <p>match_not_null</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that the expression can not be matched against an <p>Specifies that the expression can not be matched against an empty sequence.</p>
empty sequence.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>match_continuous</p> <p>match_continuous</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that the expression must match a sub-sequence that <p>Specifies that the expression must match a sub-sequence that begins at <i>first</i>.</p>
begins at <i>first</i>.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>match_partial</p> <p>match_partial</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that if no match can be found, then it is acceptable <p>Specifies that if no match can be found, then it is acceptable to return a
to return a match [from, last) where from!=last, if there exists match [from, last) where from!=last, if there exists some sequence of
some sequence of characters [from,to) of which [from,last) is a characters [from,to) of which [from,last) is a prefix, and which would result
prefix, and which would result in a full match.</p> in a full match.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>match_prev_avail</p> <p>match_prev_avail</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that <code>--first</code> is a valid iterator <p>Specifies that <code>--first</code> is a valid iterator position, when this
position, when this flag is set then the flags <code> flag is set then the flags <code>match_not_bol</code> and <code>match_not_bow</code>
match_not_bol</code> and <code>match_not_bow</code> are ignored by are ignored by the regular expression algorithms (RE.7) and iterators (RE.8).</p>
the regular expression algorithms (RE.7) and iterators (RE.8).</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%">match_not_dot_newline</td> <td valign="top" width="50%">match_not_dot_newline</td>
<td valign="top" width="50%">Specifies that the expression "." does <td valign="top" width="50%">Specifies that the expression "." does not match a
not match a newline character.</td> newline character.</td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%">match_not_dot_null</td> <td valign="top" width="50%">match_not_dot_null</td>
<td valign="top" width="50%">Specified that the expression "." does <td valign="top" width="50%">Specified that the expression "." does not match a
not match a character null '\0'.</td> character null '\0'.</td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>format_default</p> <p>format_default</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that when a regular expression match is to be replaced <p>Specifies that when a regular expression match is to be replaced by a new
by a new string, that the new string is constructed using the rules string, that the new string is constructed using the rules used by the
used by the ECMAScript replace function in ECMA-262, ECMAScript ECMAScript replace function in ECMA-262, ECMAScript Language Specification,
Language Specification, Chapter 15 part 5.4.11 Chapter 15 part 5.4.11 String.prototype.replace. (FWD.1). In addition during
String.prototype.replace. (FWD.1). In addition during search and search and replace operations then all non-overlapping occurrences of the
replace operations then all non-overlapping occurrences of the regular expression are located and replaced, and sections of the input that did
regular expression are located and replaced, and sections of the not match the expression, are copied unchanged to the output string.</p>
input that did not match the expression, are copied unchanged to
the output string.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>format_sed</p> <p>format_sed</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that when a regular expression match is to be replaced <p>Specifies that when a regular expression match is to be replaced by a new
by a new string, that the new string is constructed using the rules string, that the new string is constructed using the rules used by the Unix sed
used by the Unix sed utility in IEEE Std 1003.1-2001, Portable utility in IEEE Std 1003.1-2001, Portable Operating SystemInterface (POSIX ),
Operating SystemInterface (POSIX ), Shells and Utilities..</p> Shells and Utilities..</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>format_perl</p> <p>format_perl</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>Specifies that when a regular expression match is to be replaced <p>
by a new string, that the new string is constructed using an Specifies that when a regular expression match is to be replaced by a new
implementation defined superset of the rules used by the ECMAScript string, that the new string is constructed using the same rules as Perl 5.</p>
replace function in ECMA-262, ECMAScript Language Specification,
Chapter 15 part 5.4.11 String.prototype.replace (FWD.1).</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%" height="32">format_all</td> <td valign="top" width="50%" height="32">format_all</td>
<td valign="top" width="50%" height="32">Specifies that all syntax <td valign="top" width="50%" height="32">Specifies that all syntax extensions are
extensions are enabled, including conditional enabled, including conditional (?ddexpression1:expression2) replacements: see
(?ddexpression1:expression2) replacements.</td> the <A href="format_syntax.html">format string guide</A> for more details.</td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>format_no_copy</p> <p>format_no_copy</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>When specified during a search and replace operation, then <p>When specified during a search and replace operation, then sections of the
sections of the character container sequence being searched that do character container sequence being searched that do match the regular
match the regular expression, are not copied to the output expression, are not copied to the output string.</p>
string.</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>format_first_only</p> <p>format_first_only</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>When specified during a search and replace operation, then only <p>When specified during a search and replace operation, then only the first
the first occurrence of the regular expression is replaced.</p> occurrence of the regular expression is replaced.</p>
</td> </td>
</tr> </tr>
</table> </table>
<br> <br>
<br> <br>
<p></p> <p></p>
<hr> <hr>
<br> <br>
<br> <br>
<p>Revised <p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan --> <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
17 May 2003 17 May 2003
<!--webbot bot="Timestamp" endspan i-checksum="39359" --></p> <!--webbot bot="Timestamp" endspan i-checksum="39359" --></p>
<p><i><EFBFBD> Copyright <a href="mailto:jm@regex.fsnet.co.uk">John Maddock</a>&nbsp;1998-
<p><i>&copy; Copyright <a href="mailto:jm@regex.fsnet.co.uk">John
Maddock</a>&nbsp;1998-
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan --> <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan -->
2003 2003
<!--webbot bot="Timestamp" endspan i-checksum="39359" --></i></p> <!--webbot bot="Timestamp" endspan i-checksum="39359" --></i></p>
<p align="left"><i>Permission to use, copy, modify, distribute and sell this software
<p align="left"><i>Permission to use, copy, modify, distribute and and its documentation for any purpose is hereby granted without fee, provided
sell this software and its documentation for any purpose is hereby that the above copyright notice appear in all copies and that both that
granted without fee, provided that the above copyright notice copyright notice and this permission notice appear in supporting documentation.
appear in all copies and that both that copyright notice and this Dr John Maddock makes no representations about the suitability of this software
permission notice appear in supporting documentation. Dr John for any purpose. It is provided "as is" without express or implied warranty.</i></p>
Maddock makes no representations about the suitability of this
software for any purpose. It is provided "as is" without express or
implied warranty.</i></p>
</body> </body>
</html> </html>

View File

@ -1,76 +1,56 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html> <html>
<head> <head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<title>Boost.Regex: class match_results</title> <title>Boost.Regex: class match_results</title>
<meta http-equiv="Content-Type" content= <meta name="generator" content="HTML Tidy, see www.w3.org">
"text/html; charset=iso-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../../boost.css"> <link rel="stylesheet" type="text/css" href="../../../boost.css">
</head> </head>
<body> <body>
<p></p> <p></p>
<table id="Table1" cellspacing="1" cellpadding="1" width="100%" border="0">
<table id="Table1" cellspacing="1" cellpadding="1" width="100%"
border="0">
<tr> <tr>
<td valign="top" width="300"> <td valign="top" width="300">
<h3><a href="../../../index.htm"><img height="86" width="277" alt= <h3><a href="../../../index.htm"><img height="86" width="277" alt="C++ Boost" src="../../../c++boost.gif" border="0"></a></h3>
"C++ Boost" src="../../../c++boost.gif" border="0"></a></h3>
</td> </td>
<td width="353"> <td width="353">
<h1 align="center">Boost.Regex</h1> <h1 align="center">Boost.Regex</h1>
<h2 align="center">class match_results</h2> <h2 align="center">class match_results</h2>
</td> </td>
<td width="50"> <td width="50">
<h3><a href="index.html"><img height="45" width="43" alt= <h3><a href="index.html"><img height="45" width="43" alt="Boost.Regex Index" src="uarrow.gif" border="0"></a></h3>
"Boost.Regex Index" src="uarrow.gif" border="0"></a></h3>
</td> </td>
</tr> </tr>
</table> </table>
<br> <br>
<br> <br>
<hr> <hr>
<h3>Contents</h3> <h3>Contents</h3>
<dl class="index"> <dl class="index">
<dt><a href="#synopsis">Synopsis</a></dt> <dt><a href="#synopsis">Synopsis</a> <dt><a href="#description">Description</a></dt>
<dt><a href="#description">Description</a></dt>
</dl> </dl>
<h3><a name="synopsis"></a>Synopsis</h3> <h3><a name="synopsis"></a>Synopsis</h3>
<p>#include &lt;<a href="../../../boost/regex.hpp">boost/regex.hpp</a>&gt;</p> <p>#include &lt;<a href="../../../boost/regex.hpp">boost/regex.hpp</a>&gt;</p>
<p>Regular expressions are different from many simple pattern-matching algorithms
<p>Regular expressions are different from many simple in that as well as finding an overall match they can also produce
pattern-matching algorithms in that as well as finding an overall sub-expression matches: each sub-expression being delimited in the pattern by a
match they can also produce sub-expression matches: each pair of parenthesis (...). There has to be some method for reporting
sub-expression being delimited in the pattern by a pair of sub-expression matches back to the user: this is achieved this by defining a
parenthesis (...). There has to be some method for reporting class <i>match_results</i> that acts as an indexed collection of sub-expression
sub-expression matches back to the user: this is achieved this by matches, each sub-expression match being contained in an object of type <i><a href="sub_match.html">
defining a class <i>match_results</i> that acts as an indexed
collection of sub-expression matches, each sub-expression match
being contained in an object of type <i><a href="sub_match.html">
sub_match</a></i> .</p> sub_match</a></i> .</p>
<p>Template class match_results denotes a collection of character sequences
<p>Template class match_results denotes a collection of character representing the result of a regular expression match. Objects of type
sequences representing the result of a regular expression match. match_results are passed to the algorithms <a href="regex_match.html">regex_match</a>
Objects of type match_results are passed to the algorithms <a href="regex_match.html">regex_match</a> and <a href="regex_search.html"> and <a href="regex_search.html">regex_search</a>, and are returned by the
regex_search</a>, and are returned by the iterator <a href="regex_iterator.html">regex_iterator</a> .&nbsp; Storage for the iterator <a href="regex_iterator.html">regex_iterator</a> .&nbsp; Storage for
collection is allocated and freed as necessary by the member the collection is allocated and freed as necessary by the member functions of
functions of class match_results.</p> class match_results.</p>
<p>The template class match_results conforms to the requirements of a Sequence, as
<p>The template class match_results conforms to the requirements of specified in (lib.sequence.reqmts), except that only operations defined for
a Sequence, as specified in (lib.sequence.reqmts), except that only const-qualified Sequences are supported.</p>
operations defined for const-qualified Sequences are supported.</p> <p>Class template match_results is most commonly used as one of the typedefs
cmatch, wcmatch, smatch, or wsmatch:</p>
<p>Class template match_results is most commonly used as one of the
typedefs cmatch, wcmatch, smatch, or wsmatch:</p>
<pre> <pre>
template &lt;class BidirectionalIterator, template &lt;class BidirectionalIterator,
class Allocator = allocator&lt;sub_match&lt;BidirectionalIterator&gt; &gt; class Allocator = allocator&lt;sub_match&lt;BidirectionalIterator&gt; &gt;
@ -98,77 +78,68 @@ public:
typedef basic_string&lt;char_type&gt; string_type; typedef basic_string&lt;char_type&gt; string_type;
// construct/copy/destroy: // construct/copy/destroy:
explicit match_results(const Allocator&amp; a = Allocator()); explicit <A href="#c1">match_results</A>(const Allocator&amp; a = Allocator());
match_results(const match_results&amp; m); <A href="#c2">match_results</A>(const match_results&amp; m);
match_results&amp; operator=(const match_results&amp; m); <A href="#c3">match_results</A>&amp; <A href="#c3">operator</A>=(const match_results&amp; m);
~match_results(); ~match_results();
// size: // size:
size_type size() const; size_type <A href="#m1">size</A>() const;
size_type max_size() const; size_type <A href="#m2">max_size</A>() const;
bool empty() const; bool <A href="#m3">empty</A>() const;
// element access: // element access:
difference_type length(int sub = 0) const; difference_type <A href="#m4">length</A>(int sub = 0) const;
difference_type position(unsigned int sub = 0) const; difference_type <A href="#m5">position</A>(unsigned int sub = 0) const;
string_type str(int sub = 0) const; string_type <A href="#m6">str</A>(int sub = 0) const;
const_reference operator[](int n) const; const_reference <A href="#m7">operator</A>[](int n) const;
const_reference prefix() const; const_reference <A href="#m8">prefix</A>() const;
const_reference suffix() const; const_reference <A href="#m9">suffix</A>() const;
const_iterator begin() const; const_iterator <A href="#m10">begin</A>() const;
const_iterator end() const; const_iterator <A href="#m11">end</A>() const;
// format: // format:
template &lt;class OutputIterator&gt; template &lt;class OutputIterator&gt;
OutputIterator format(OutputIterator out, OutputIterator <A href="#m12">format</A>(OutputIterator out,
const string_type&amp; fmt, const string_type&amp; fmt,
match_flag_type flags = format_default) const; match_flag_type flags = format_default) const;
string_type format(const string_type&amp; fmt, string_type <A href="#m13">format</A>(const string_type&amp; fmt,
match_flag_type flags = format_default) const; match_flag_type flags = format_default) const;
allocator_type get_allocator() const; allocator_type <A href="#m14">get_allocator</A>() const;
void swap(match_results&amp; that); void <A href="#m15">swap</A>(match_results&amp; that);
}; };
template &lt;class BidirectionalIterator, class Allocator&gt; template &lt;class BidirectionalIterator, class Allocator&gt;
bool operator == (const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m1, bool <A href="#n1">operator</A> == (const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m1,
const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m2); const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m2);
template &lt;class BidirectionalIterator, class Allocator&gt; template &lt;class BidirectionalIterator, class Allocator&gt;
bool operator != (const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m1, bool <A href="#n2">operator</A> != (const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m1,
const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m2); const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m2);
template &lt;class charT, class traits, class BidirectionalIterator, class Allocator&gt; template &lt;class charT, class traits, class BidirectionalIterator, class Allocator&gt;
basic_ostream&lt;charT, traits&gt;&amp; basic_ostream&lt;charT, traits&gt;&amp;
operator &lt;&lt; (basic_ostream&lt;charT, traits&gt;&amp; os, <A href="#n3">operator</A> &lt;&lt; (basic_ostream&lt;charT, traits&gt;&amp; os,
const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m); const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m);
template &lt;class BidirectionalIterator, class Allocator&gt; template &lt;class BidirectionalIterator, class Allocator&gt;
void swap(match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m1, void <A href="#n4">swap</A>(match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m1,
match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m2); match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m2);
</pre> </pre>
<h3><a name="description"></a>Description</h3> <h3><a name="description"></a>Description</h3>
<h4>match_results constructors</h4> <h4>match_results constructors</h4>
<p>In all <code>match_results</code> constructors, a copy of the Allocator
<p>In all <code>match_results</code> constructors, a copy of the argument is used for any memory allocation performed by the constructor or
Allocator argument is used for any memory allocation performed by member functions during the lifetime of the object.</p>
the constructor or member functions during the lifetime of the <pre><A name=c1></A>
object.</p>
<pre>
match_results(const Allocator&amp; a = Allocator()); match_results(const Allocator&amp; a = Allocator());
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Constructs an object of class match_results. The <p><b>Effects:</b> Constructs an object of class match_results. The postconditions
postconditions of this function are indicated in the table:</p> of this function are indicated in the table:</p>
<p align="center"></p> <p align="center"></p>
<center> <center>
<table id="Table2" cellspacing="1" cellpadding="7" width="624" <table id="Table2" cellspacing="1" cellpadding="7" width="624" border="1">
border="1">
<tbody> <tbody>
<tr> <tr>
<td valign="top" width="50%"><b></b> <td valign="top" width="50%"><b></b>
@ -178,7 +149,6 @@ border="1">
<p><b>Value</b></p> <p><b>Value</b></p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>empty()</p> <p>empty()</p>
@ -187,7 +157,6 @@ border="1">
<p>true</p> <p>true</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>size()</p> <p>size()</p>
@ -196,7 +165,6 @@ border="1">
<p>0</p> <p>0</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>str()</p> <p>str()</p>
@ -208,30 +176,21 @@ border="1">
</tbody> </tbody>
</table> </table>
</center> </center>
<p>&nbsp;</p> <p>&nbsp;</p>
<pre><A name=c2></A>
<pre>
match_results(const match_results&amp; m); match_results(const match_results&amp; m);
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Constructs an object of class match_results, as <p><b>Effects:</b> Constructs an object of class match_results, as a copy of m.</p>
a copy of m.</p> <pre><A name=c3></A>
<pre>
match_results&amp; operator=(const match_results&amp; m); match_results&amp; operator=(const match_results&amp; m);
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Assigns m to *this. The postconditions of this <p><b>Effects:</b> Assigns m to *this. The postconditions of this function are
function are indicated in the table:</p> indicated in the table:</p>
<p align="center"></p> <p align="center"></p>
<center> <center>
<table id="Table3" cellspacing="1" cellpadding="7" width="624" <table id="Table3" cellspacing="1" cellpadding="7" width="624" border="1">
border="1">
<tbody> <tbody>
<tr> <tr>
<td valign="top" width="50%"><b></b> <td valign="top" width="50%"><b></b>
@ -241,7 +200,6 @@ border="1">
<p><b>Value</b></p> <p><b>Value</b></p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>empty()</p> <p>empty()</p>
@ -250,7 +208,6 @@ border="1">
<p>m.empty().</p> <p>m.empty().</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>size()</p> <p>size()</p>
@ -259,7 +216,6 @@ border="1">
<p>m.size().</p> <p>m.size().</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>str(n)</p> <p>str(n)</p>
@ -268,7 +224,6 @@ border="1">
<p>m.str(n) for all integers n &lt; m.size().</p> <p>m.str(n) for all integers n &lt; m.size().</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>prefix()</p> <p>prefix()</p>
@ -277,7 +232,6 @@ border="1">
<p>m.prefix().</p> <p>m.prefix().</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>suffix()</p> <p>suffix()</p>
@ -286,7 +240,6 @@ border="1">
<p>m.suffix().</p> <p>m.suffix().</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>(*this)[n]</p> <p>(*this)[n]</p>
@ -295,7 +248,6 @@ border="1">
<p>m[n] for all integers n &lt; m.size().</p> <p>m[n] for all integers n &lt; m.size().</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>length(n)</p> <p>length(n)</p>
@ -304,7 +256,6 @@ border="1">
<p>m.length(n) for all integers n &lt; m.size().</p> <p>m.length(n) for all integers n &lt; m.size().</p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>position(n)</p> <p>position(n)</p>
@ -316,196 +267,165 @@ border="1">
</tbody> </tbody>
</table> </table>
</center> </center>
<h4>match_results size</h4> <h4>match_results size</h4>
<pre><A name=m1></A>
<pre>
size_type size()const; size_type size()const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns the number of sub_match elements stored <p><b>Effects:</b> Returns the number of sub_match elements stored in *this; that
in *this.</p> is the number of marked sub-expressions in the regular expression that was
matched plus one.</p>
<pre> <pre><A name=m2></A>
size_type max_size()const; size_type max_size()const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns the maximum number of sub_match elements <p><b>Effects:</b> Returns the maximum number of sub_match elements that can be
that can be stored in *this.</p> stored in *this.</p>
<pre><A name=m3></A>
<pre>
bool empty()const; bool empty()const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns <code>size() == 0</code>.</p> <p><b>Effects:</b> Returns <code>size() == 0</code>.</p>
<h4>match_results element access</h4> <h4>match_results element access</h4>
<pre><A name=m4></A>
<pre>
difference_type length(int sub = 0)const; difference_type length(int sub = 0)const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns <code>(*this)[sub].length()</code>.</p> <p><b>Effects:</b> Returns the length of sub-expression <EM>sub</EM>, that is to
say: <code>(*this)[sub].length()</code>.</p>
<pre> <pre><A name=m5></A>
difference_type position(unsigned int sub = 0)const; difference_type position(unsigned int sub = 0)const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns <code>std::distance(prefix().first, <p><b>Effects:</b> Returns the starting location of sub-expression <EM>sub</EM>,
(*this)[sub].first).</code></p> or -1 if <EM>sub</EM> was not matched <code>.</code></p>
<pre><A name=m6></A>
<pre>
string_type str(int sub = 0)const; string_type str(int sub = 0)const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns <code> <p><b>Effects:</b> Returns sub-expression <EM>sub</EM> as a string:&nbsp; <code>string_type((*this)[sub]).</code></p>
string_type((*this)[sub]).</code></p> <pre><A name=m7></A>
<pre>
const_reference operator[](int n) const; const_reference operator[](int n) const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns a reference to the <code> <p><b>Effects:</b> Returns a reference to the <code>sub_match</code> object
sub_match</code> object representing the character sequence that representing the character sequence that matched marked sub-expression <i>n</i>.
matched marked sub-expression <i>n</i>. If <code>n == 0</code> then If <code>n == 0</code> then returns a reference to a <code>sub_match</code> object
returns a reference to a <code>sub_match</code> object representing representing the character sequence that matched the whole regular
the character sequence that matched the whole regular expression.&nbsp; If <EM>n</EM> is out of range, or if <EM>n</EM> is an
expression.</p> unmatched sub-expression, then returns a sub_match object whose <EM>matched</EM>
member is <EM>false</EM>.</p>
<pre> <pre><A name=m8></A>
const_reference prefix()const; const_reference prefix()const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns a reference to the <code> <p><b>Effects:</b> Returns a reference to the <code>sub_match</code> object
sub_match</code> object representing the character sequence from representing the character sequence from the start of the string being
the start of the string being matched/searched, to the start of the matched/searched, to the start of the match found.</p>
match found.</p> <pre><A name=m9></A>
<pre>
const_reference suffix()const; const_reference suffix()const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns a reference to the <code> <p><b>Effects:</b> Returns a reference to the <code>sub_match</code> object
sub_match</code> object representing the character sequence from representing the character sequence from the end of the match found to the end
the end of the match found to the end of the string being of the string being matched/searched.</p>
matched/searched.</p> <pre><A name=m10></A>
<pre>
const_iterator begin()const; const_iterator begin()const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns a starting iterator that enumerates over <p><b>Effects:</b> Returns a starting iterator that enumerates over all the marked
all the marked sub-expression matches stored in *this.</p> sub-expression matches stored in *this.</p>
<pre><A name=m11></A>
<pre>
const_iterator end()const; const_iterator end()const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns a terminating iterator that enumerates <p><b>Effects:</b> Returns a terminating iterator that enumerates over all the
over all the marked sub-expression matches stored in *this.</p> marked sub-expression matches stored in *this.</p>
<h4><A name="format"></A>match_results reformatting</h4>
<h4>match_results reformatting</h4> <pre><A name=m12></A>
<pre>
template &lt;class OutputIterator&gt; template &lt;class OutputIterator&gt;
OutputIterator format(OutputIterator out, OutputIterator format(OutputIterator out,
const string_type&amp; fmt, const string_type&amp; fmt,
<a href="match_flag_type.html">match_flag_type</a> flags = format_default); <a href="match_flag_type.html">match_flag_type</a> flags = format_default);
</pre> </pre>
<b></b> <b></b>
<p><b>Requires:</b> The type OutputIterator conforms to the Output <p><b>Requires:</b> The type OutputIterator conforms to the Output Iterator
Iterator requirements (24.1.2).</p> requirements (24.1.2).</p>
<b></b> <b></b>
<p><b>Effects:</b> Copies the character sequence <i>[fmt.begin(), <p><b>Effects:</b> Copies the character sequence <i>[fmt.begin(), fmt.end())</i> to
fmt.end())</i> to OutputIterator <i>out</i>. For each format OutputIterator <i>out</i>. For each format specifier or escape sequence in <i>fmt</i>,
specifier or escape sequence in <i>fmt</i>, replace that sequence replace that sequence with either the character(s) it represents, or the
with either the character(s) it represents, or the sequence of sequence of characters within *this to which it refers. The bitmasks specified
characters within *this to which it refers. The bitmasks specified in <i><a href="match_flag_type.html">flags</a></i> determines what <a href="format_syntax.html">
in <i><a href="match_flag_type.html">flags</a></i> determines what format specifiers or escape sequences are recognized</a>, by default this is
<a href="format_syntax.html">format specifiers or escape sequences the format used by ECMA-262, ECMAScript Language Specification, Chapter 15 part
are recognized</a>, by default this is the format used by ECMA-262, 5.4.11 String.prototype.replace.</p>
ECMAScript Language Specification, Chapter 15 part 5.4.11
String.prototype.replace.</p>
<b></b> <b></b>
<p><b>Returns:</b> <i>out</i>.</p> <p><b>Returns:</b> <i>out</i>.</p>
<pre><A name=m13></A>
<pre>
string_type format(const string_type&amp; fmt, string_type format(const string_type&amp; fmt,
<a href="match_flag_type.html">match_flag_type</a> flags = format_default); <a href="match_flag_type.html">match_flag_type</a> flags = format_default);
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns a copy of the string <i>fmt</i>. For <p><b>Effects:</b> Returns a copy of the string <i>fmt</i>. For each format
each format specifier or escape sequence in <i>fmt</i>, replace specifier or escape sequence in <i>fmt</i>, replace that sequence with either
that sequence with either the character(s) it represents, or the the character(s) it represents, or the sequence of characters within *this to
sequence of characters within *this to which it refers. The which it refers. The bitmasks specified in <i><a href="match_flag_type.html">flags</a></i>
bitmasks specified in <i><a href="match_flag_type.html"> determines what <a href="format_syntax.html">format specifiers or escape sequences
flags</a></i> determines what <a href="format_syntax.html">format are recognized</a>, by default this is the format used by ECMA-262,
specifiers or escape sequences are recognized</a>, by default this ECMAScript Language Specification, Chapter 15 part 5.4.11
is the format used by ECMA-262, ECMAScript Language Specification, String.prototype.replace.</p>
Chapter 15 part 5.4.11 String.prototype.replace.</p> <pre><A name=m14></A>
<pre>
allocator_type get_allocator()const; allocator_type get_allocator()const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Returns a copy of the Allocator that was passed <p><b>Effects:</b> Returns a copy of the Allocator that was passed to the object's
to the object's constructor.</p> constructor.</p>
<pre><A name=m15></A>
<pre>
void swap(match_results&amp; that); void swap(match_results&amp; that);
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> Swaps the contents of the two sequences.</p> <p><b>Effects:</b> Swaps the contents of the two sequences.</p>
<b></b> <b></b>
<p><b>Postcondition:</b> <code>*this</code> contains the sequence <p><b>Postcondition:</b> <code>*this</code> contains the sequence of matched
of matched sub-expressions that were in <code>that</code>, <code> sub-expressions that were in <code>that</code>, <code>that</code> contains the
that</code> contains the sequence of matched sub-expressions that sequence of matched sub-expressions that were in <code>*this</code>.</p>
were in <code>*this</code>.</p>
<b></b> <b></b>
<p><b>Complexity:</b> constant time.</p> <p><b>Complexity:</b> constant time.</p>
<h4>match_results non-members</h4>
<PRE><A name=n1></A>template &lt;class BidirectionalIterator, class Allocator&gt;
bool operator == (const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m1,
const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m2);</PRE>
<P><B>Effects:</B> Compares the two sequences for equality.</P>
<PRE><A name=n2></A>template &lt;class BidirectionalIterator, class Allocator&gt;
bool operator != (const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m1,
const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m2);</PRE>
<P><B>Effects:</B> Compares the two sequences for inequality.</P>
<PRE><A name=n3></A>template &lt;class charT, class traits, class BidirectionalIterator, class Allocator&gt;
basic_ostream&lt;charT, traits&gt;&amp;
operator &lt;&lt; (basic_ostream&lt;charT, traits&gt;&amp; os,
const match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m);</PRE>
<P><B>Effects:</B> Writes the contents of <EM>m</EM> to the stream <EM>os</EM> as
if by calling <code>os &lt;&lt; m.str();</code> Returns <EM>os</EM>..</P>
<PRE><A name=n4></A>template &lt;class BidirectionalIterator, class Allocator&gt;
void swap(match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m1,
match_results&lt;BidirectionalIterator, Allocator&gt;&amp; m2);</PRE>
<P><B>Effects:</B> Swaps the contents of the two sequences.</P>
<p></p> <p></p>
<hr> <hr>
<p>Revised <p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan --> <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
17 May 2003 17 May 2003
<!--webbot bot="Timestamp" endspan i-checksum="39359" --></p> <!--webbot bot="Timestamp" endspan i-checksum="39359" --></p>
<p><i><EFBFBD> Copyright <a href="mailto:jm@regex.fsnet.co.uk">John Maddock</a>&nbsp;1998-
<p><i>&copy; Copyright <a href="mailto:jm@regex.fsnet.co.uk">John
Maddock</a>&nbsp;1998-
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan --> <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan -->
2003 2003
<!--webbot bot="Timestamp" endspan i-checksum="39359" --></i></p> <!--webbot bot="Timestamp" endspan i-checksum="39359" --></i></p>
<p align="left"><i>Permission to use, copy, modify, distribute and sell this software
<p align="left"><i>Permission to use, copy, modify, distribute and and its documentation for any purpose is hereby granted without fee, provided
sell this software and its documentation for any purpose is hereby that the above copyright notice appear in all copies and that both that
granted without fee, provided that the above copyright notice copyright notice and this permission notice appear in supporting documentation.
appear in all copies and that both that copyright notice and this Dr John Maddock makes no representations about the suitability of this software
permission notice appear in supporting documentation. Dr John for any purpose. It is provided "as is" without express or implied warranty.</i></p>
Maddock makes no representations about the suitability of this
software for any purpose. It is provided "as is" without express or
implied warranty.</i></p>
</body> </body>
</html> </html>

View File

@ -25,14 +25,15 @@
<HR> <HR>
<p></p> <p></p>
<P>If you are using Microsoft or Borland C++ and link to a dll version of the run <P>If you are using Microsoft or Borland C++ and link to a dll version of the run
time library, then you will also link to one of the dll versions of time library, then you can choose to also link to a dll version of boost.regex
boost.regex. While these dll's are redistributable, there are no "standard" by defining the symbol BOOST_REGEX_DYN_LINK when you compile your code. While
versions, so when installing on the users PC, you should place these in a these dll's are redistributable, there are no "standard" versions, so when
directory private to your application, and not in the PC's directory path. Note installing on the users PC, you should place these in a directory private to
that if you link to a static version of your run time library, then you will your application, and not in the PC's directory path. Note that if you link to
also link to a static version of boost.regex and no dll's will need to be a static version of your run time library, then you will also link to a static
distributed. The possible boost.regex dll and library names are computed version of boost.regex and no dll's will need to be distributed. The possible
according to the following formula:<BR> boost.regex dll and library names are computed according to the following
formula:<BR>
</P> </P>
<P></P> <P></P>
<P>BOOST_LIB_PREFIX<BR> <P>BOOST_LIB_PREFIX<BR>

View File

@ -42,40 +42,39 @@ template &lt;class BidirectionalIterator,
class regex_iterator class regex_iterator
{ {
public: public:
typedef basic_regex&lt;charT, traits, Allocator&gt; regex_type; typedef <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator&gt; regex_type;
typedef match_results&lt;BidirectionalIterator&gt; value_type; typedef <A href="match_results.html">match_results</A>&lt;BidirectionalIterator&gt; value_type;
typedef typename iterator_traits&lt;BidirectionalIterator&gt;::difference_type difference_type; typedef typename iterator_traits&lt;BidirectionalIterator&gt;::difference_type difference_type;
typedef const value_type* pointer; typedef const value_type* pointer;
typedef const value_type&amp; reference; typedef const value_type&amp; reference;
typedef std::forward_iterator_tag iterator_category; typedef std::forward_iterator_tag iterator_category;
regex_iterator(); <A href="#c1">regex_iterator</A>();
regex_iterator(BidirectionalIterator a, BidirectionalIterator b, <A href="#c2">regex_iterator</A>(BidirectionalIterator a, BidirectionalIterator b,
const regex_type&amp; re, const regex_type&amp; re,
match_flag_type m = match_default); <A href="match_flag_type.html">match_flag_type</A> m = match_default);
regex_iterator(const regex_iterator&amp;); <A href="#c3">regex_iterator</A>(const regex_iterator&amp;);
regex_iterator&amp; operator=(const regex_iterator&amp;); regex_iterator&amp; <A href="#o1">operator</A>=(const regex_iterator&amp;);
bool operator==(const regex_iterator&amp;); bool <A href="#o2">operator</A>==(const regex_iterator&amp;)const;
bool operator!=(const regex_iterator&amp;); bool <A href="#o3">operator</A>!=(const regex_iterator&amp;)const;
const value_type&amp; operator*(); const value_type&amp; <A href="#o4">operator</A>*()const;
const value_type* operator-&gt;(); const value_type* <A href="#o5">operator</A>-&gt;()const;
regex_iterator&amp; operator++(); regex_iterator&amp; <A href="#o6">operator</A>++();
regex_iterator operator++(int); regex_iterator <A href="#o7">operator</A>++(int);
}; };
</pre> </pre>
<h3><a name="description"></a>Description</h3> <h3><a name="description"></a>Description</h3>
<p>A regex_iterator is constructed from a pair of iterators, and enumerates all <p>A regex_iterator is constructed from a pair of iterators, and enumerates all
occurrences of a regular expression within that iterator range.</p> occurrences of a regular expression within that iterator range.</p>
<pre> <pre><A name=c1></A>
regex_iterator(); regex_iterator();
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> constructs an end of sequence regex_iterator.</p> <p><b>Effects:</b> constructs an end of sequence regex_iterator.</p>
<pre> <pre><A name=c2></A>regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
const regex_type&amp; re, const regex_type&amp; re,
match_flag_type m = match_default); <A href="match_flag_type.html">match_flag_type</A> m = match_default);
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> constructs a regex_iterator that will enumerate all occurrences <p><b>Effects:</b> constructs a regex_iterator that will enumerate all occurrences
@ -88,32 +87,32 @@ regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
Boost.regex is <A href="configuration.html">configured</A> in recursive mode), Boost.regex is <A href="configuration.html">configured</A> in recursive mode),
or if the matcher exhausts it's permitted memory allocation (if Boost.regex is <A href="configuration.html"> or if the matcher exhausts it's permitted memory allocation (if Boost.regex is <A href="configuration.html">
configured</A> in non-recursive mode).</P> configured</A> in non-recursive mode).</P>
<pre> <pre><A name=c3></A>
regex_iterator(const regex_iterator&amp; that); regex_iterator(const regex_iterator&amp; that);
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> constructs a copy of <code>that</code>.</p> <p><b>Effects:</b> constructs a copy of <code>that</code>.</p>
<b></b> <b></b>
<p><b>Postconditions:</b> <code>*this == that</code>.</p> <p><b>Postconditions:</b> <code>*this == that</code>.</p>
<pre> <pre><A name=o1></A>
regex_iterator&amp; operator=(const regex_iterator&amp;); regex_iterator&amp; operator=(const regex_iterator&amp;);
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> sets&nbsp;<code>*this</code> equal to those in <code>that</code>.</p> <p><b>Effects:</b> sets&nbsp;<code>*this</code> equal to those in <code>that</code>.</p>
<b></b> <b></b>
<p><b>Postconditions:</b> <code>*this == that</code>.</p> <p><b>Postconditions:</b> <code>*this == that</code>.</p>
<pre> <pre><A name=o2></A>
bool operator==(const regex_iterator&amp; that); bool operator==(const regex_iterator&amp; that)const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> returns true if *this is equal to that.</p> <p><b>Effects:</b> returns true if *this is equal to that.</p>
<pre> <pre><A name=o3></A>
bool operator!=(const regex_iterator&amp;); bool operator!=(const regex_iterator&amp;)const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> returns <code>!(*this == that)</code>.</p> <p><b>Effects:</b> returns <code>!(*this == that)</code>.</p>
<pre> <pre><A name=o4></A>
const value_type&amp; operator*(); const value_type&amp; operator*()const;
</pre> </pre>
<p><b>Effects:</b> dereferencing a regex_iterator object <em>it</em> yields a <p><b>Effects:</b> dereferencing a regex_iterator object <em>it</em> yields a
const reference to a <a href="match_results.html">match_results</a> object, const reference to a <a href="match_results.html">match_results</a> object,
@ -159,7 +158,8 @@ const value_type&amp; operator*();
<p>(*it).prefix().last</p> <p>(*it).prefix().last</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>(*it)[0].first</p> <p>The same as the start of the match found:<BR>
(*it)[0].first</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -167,7 +167,8 @@ const value_type&amp; operator*();
<p>(*it).prefix().matched</p> <p>(*it).prefix().matched</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>(*it).prefix().first != (*it).prefix().second</p> <p>True if the prefix did not match an empty string:<BR>
(*it).prefix().first != (*it).prefix().second</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -175,7 +176,8 @@ const value_type&amp; operator*();
<p>(*it).suffix().first</p> <p>(*it).suffix().first</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>(*it)[0].second</p> <p>The same as the end of the match found:<BR>
(*it)[0].second</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -191,7 +193,8 @@ const value_type&amp; operator*();
<p>(*it).suffix().matched</p> <p>(*it).suffix().matched</p>
</td> </td>
<td valign="top" width="50%"> <td valign="top" width="50%">
<p>(*it).suffix().first != (*it).suffix().second</p> <p>True if the suffix did not match an empty string:<BR>
(*it).suffix().first != (*it).suffix().second</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -259,12 +262,12 @@ const value_type&amp; operator*();
</table> </table>
<br> <br>
<br> <br>
<pre> <pre><A name=o5></A>
const value_type* operator-&gt;(); const value_type* operator-&gt;()const;
</pre> </pre>
<b></b> <b></b>
<p><b>Effects:</b> returns <code>&amp;(*this)</code>.</p> <p><b>Effects:</b> returns <code>&amp;(*this)</code>.</p>
<pre> <pre><A name=o6></A>
regex_iterator&amp; operator++(); regex_iterator&amp; operator++();
</pre> </pre>
<p><strong>Effects:</strong> moves the iterator to the next match in the <p><strong>Effects:</strong> moves the iterator to the next match in the
@ -282,7 +285,7 @@ regex_iterator&amp; operator++();
configured</A> in non-recursive mode).</P> configured</A> in non-recursive mode).</P>
<b></b> <b></b>
<p><b>Returns:</b> <code>*this</code>.</p> <p><b>Returns:</b> <code>*this</code>.</p>
<pre> <pre><A name=o7></A>
regex_iterator operator++(int); regex_iterator operator++(int);
</pre> </pre>
<b></b> <b></b>

View File

@ -31,47 +31,53 @@
</dl> </dl>
<H3><A name="synopsis"></A>Synopsis</H3> <H3><A name="synopsis"></A>Synopsis</H3>
<PRE><A name=query_match></A>#include &lt;<A href="../../../boost/regex.hpp">boost/regex.hpp</A>&gt; </PRE> <PRE><A name=query_match></A>#include &lt;<A href="../../../boost/regex.hpp">boost/regex.hpp</A>&gt; </PRE>
<P>The algorithm regex _match determines whether a given regular expression <P>
matches a given sequence denoted by a pair of bidirectional-iterators, the The algorithm regex _match determines whether a given regular expression
algorithm is defined as follows, <STRONG>note that the result is true only if the matches all of a given character sequence denoted by a pair of
expression matches the whole of the input sequence</STRONG>, the main use of bidirectional-iterators, the algorithm is defined as follows, the main use of
this function is data input validation. this function is data input validation.
<P><STRONG>Note that the result is true only if the expression matches the whole of
the input sequence.&nbsp;</STRONG> If you want to search for an expression
somewhere within the sequence then use <A href="regex_search.html">regex_search</A>.&nbsp;
If you want to match a prefix of the character string then use <A href="regex_search.html">
regex_search</A> with the flag <A href="match_flag_type.html">match_continuous</A>
set.
<PRE>template &lt;class BidirectionalIterator, class Allocator, class charT, <PRE>template &lt;class BidirectionalIterator, class Allocator, class charT,
class traits, class Allocator2&gt; class traits, class Allocator2&gt;
bool regex_match(BidirectionalIterator first, BidirectionalIterator last, bool <A href="#f1">regex_match</A>(BidirectionalIterator first, BidirectionalIterator last,
<A href="match_results.html">match_results</A>&lt;BidirectionalIterator, Allocator&gt;&amp; m, <A href="match_results.html">match_results</A>&lt;BidirectionalIterator, Allocator&gt;&amp; m,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default); <A href="match_flag_type.html">match_flag_type</A> flags = match_default);
template &lt;class BidirectionalIterator, class charT, class traits, class Allocator2&gt; template &lt;class BidirectionalIterator, class charT, class traits, class Allocator2&gt;
bool regex_match(BidirectionalIterator first, BidirectionalIterator last, bool <A href="#f2">regex_match</A>(BidirectionalIterator first, BidirectionalIterator last,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default); <A href="match_flag_type.html">match_flag_type</A> flags = match_default);
template &lt;class charT, class Allocator, class traits, class Allocator2&gt; template &lt;class charT, class Allocator, class traits, class Allocator2&gt;
bool regex_match(const charT* str, <A href="match_results.html">match_results</A>&lt;const charT*, Allocator&gt;&amp; m, bool <A href="#f3">regex_match</A>(const charT* str, <A href="match_results.html">match_results</A>&lt;const charT*, Allocator&gt;&amp; m,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default); <A href="match_flag_type.html">match_flag_type</A> flags = match_default);
template &lt;class ST, class SA, class Allocator, class charT, template &lt;class ST, class SA, class Allocator, class charT,
class traits, class Allocator2&gt; class traits, class Allocator2&gt;
bool regex_match(const basic_string&lt;charT, ST, SA&gt;&amp; s, bool <A href="#f4">regex_match</A>(const basic_string&lt;charT, ST, SA&gt;&amp; s,
<A href="match_results.html">match_results</A>&lt;typename basic_string&lt;charT, ST, SA&gt;::const_iterator, Allocator&gt;&amp; m, <A href="match_results.html">match_results</A>&lt;typename basic_string&lt;charT, ST, SA&gt;::const_iterator, Allocator&gt;&amp; m,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default); <A href="match_flag_type.html">match_flag_type</A> flags = match_default);
template &lt;class charT, class traits, class Allocator2&gt; template &lt;class charT, class traits, class Allocator2&gt;
bool regex_match(const charT* str, bool <A href="#f5">regex_match</A>(const charT* str,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default); <A href="match_flag_type.html">match_flag_type</A> flags = match_default);
template &lt;class ST, class SA, class charT, class traits, class Allocator2&gt; template &lt;class ST, class SA, class charT, class traits, class Allocator2&gt;
bool regex_match(const basic_string&lt;charT, ST, SA&gt;&amp; s, bool <A href="#f6">regex_match</A>(const basic_string&lt;charT, ST, SA&gt;&amp; s,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default); <A href="match_flag_type.html">match_flag_type</A> flags = match_default);
</PRE> </PRE>
<H3><A name="description"></A>Description</H3> <H3><A name="description"></A>Description</H3>
<PRE>template &lt;class BidirectionalIterator, class Allocator, class charT, <PRE><A name=f1></A>template &lt;class BidirectionalIterator, class Allocator, class charT,
class traits, class Allocator2&gt; class traits, class Allocator2&gt;
bool regex_match(BidirectionalIterator first, BidirectionalIterator last, bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
<A href="match_results.html">match_results</A>&lt;BidirectionalIterator, Allocator&gt;&amp; m, <A href="match_results.html">match_results</A>&lt;BidirectionalIterator, Allocator&gt;&amp; m,
@ -84,9 +90,9 @@ bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
flags</I> is used to <A href="match_flag_type.html">control how the expression flags</I> is used to <A href="match_flag_type.html">control how the expression
is matched</A> against the character sequence. Returns true if such a match is matched</A> against the character sequence. Returns true if such a match
exists, false otherwise.</P> exists, false otherwise.</P>
<P><STRONG>Throws:</STRONG> <code>std::runtime_error</code> if the complexity of matching the <P><STRONG>Throws:</STRONG> <code>std::runtime_error</code> if the complexity of
expression against an N character string begins to exceed O(N<SUP>2</SUP>), or matching the expression against an N character string begins to exceed O(N<SUP>2</SUP>),
if the program runs out of stack space while matching the expression (if or if the program runs out of stack space while matching the expression (if
Boost.regex is <A href="configuration.html">configured</A> in recursive mode), Boost.regex is <A href="configuration.html">configured</A> in recursive mode),
or if the matcher exhausts it's permitted memory allocation (if Boost.regex is <A href="configuration.html"> or if the matcher exhausts it's permitted memory allocation (if Boost.regex is <A href="configuration.html">
configured</A> in non-recursive mode).</P> configured</A> in non-recursive mode).</P>
@ -231,20 +237,20 @@ bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
<P></P> <P></P>
<DIV></DIV> <DIV></DIV>
<PRE>&nbsp;</PRE> <PRE>&nbsp;</PRE>
<PRE>template &lt;class BidirectionalIterator, class charT, class traits, class Allocator2&gt; <PRE><A name=f2></A>template &lt;class BidirectionalIterator, class charT, class traits, class Allocator2&gt;
bool regex_match(BidirectionalIterator first, BidirectionalIterator last, bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE> <A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE>
<P><B> Effects:</B> Behaves "as if" by constructing an instance of <CODE><A href="match_results.html"> <P><B> Effects:</B> Behaves "as if" by constructing an instance of <CODE><A href="match_results.html">
match_results</A>&lt;</CODE>BidirectionalIterator<CODE>&gt; what</CODE>, match_results</A>&lt;</CODE>BidirectionalIterator<CODE>&gt; what</CODE>,
and then returning the result of <CODE>regex_match(first, last, what, e, flags)</CODE>.</P> and then returning the result of <CODE>regex_match(first, last, what, e, flags)</CODE>.</P>
<PRE>template &lt;class charT, class Allocator, class traits, class Allocator2&gt; <PRE><A name=f3></A>template &lt;class charT, class Allocator, class traits, class Allocator2&gt;
bool regex_match(const charT* str, <A href="match_results.html">match_results</A>&lt;const charT*, Allocator&gt;&amp; m, bool regex_match(const charT* str, <A href="match_results.html">match_results</A>&lt;const charT*, Allocator&gt;&amp; m,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE> <A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE>
<P><B> Effects:</B> Returns the result of <CODE>regex_match(str, str + <P><B> Effects:</B> Returns the result of <CODE>regex_match(str, str +
char_traits&lt;charT&gt;::length(str), m, e, flags)</CODE>.</P> char_traits&lt;charT&gt;::length(str), m, e, flags)</CODE>.</P>
<PRE>template &lt;class ST, class SA, class Allocator, class charT, <PRE><A name=f4></A>template &lt;class ST, class SA, class Allocator, class charT,
class traits, class Allocator2&gt; class traits, class Allocator2&gt;
bool regex_match(const basic_string&lt;charT, ST, SA&gt;&amp; s, bool regex_match(const basic_string&lt;charT, ST, SA&gt;&amp; s,
<A href="match_results.html">match_results</A>&lt;typename basic_string&lt;charT, ST, SA&gt;::const_iterator, Allocator&gt;&amp; m, <A href="match_results.html">match_results</A>&lt;typename basic_string&lt;charT, ST, SA&gt;::const_iterator, Allocator&gt;&amp; m,
@ -252,13 +258,13 @@ bool regex_match(const basic_string&lt;charT, ST, SA&gt;&amp; s,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE> <A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE>
<P><B> Effects:</B> Returns the result of <CODE>regex_match(s.begin(), s.end(), m, e, <P><B> Effects:</B> Returns the result of <CODE>regex_match(s.begin(), s.end(), m, e,
flags)</CODE>.</P> flags)</CODE>.</P>
<PRE>template &lt;class charT, class traits, class Allocator2&gt; <PRE><A name=f5></A>template &lt;class charT, class traits, class Allocator2&gt;
bool regex_match(const charT* str, bool regex_match(const charT* str,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE> <A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE>
<P><B> Effects:</B> Returns the result of <CODE>regex_match(str, str + <P><B> Effects:</B> Returns the result of <CODE>regex_match(str, str +
char_traits&lt;charT&gt;::length(str), e, flags)</CODE>.</P> char_traits&lt;charT&gt;::length(str), e, flags)</CODE>.</P>
<PRE>template &lt;class ST, class SA, class charT, class traits, class Allocator2&gt; <PRE><A name=f6></A>template &lt;class ST, class SA, class charT, class traits, class Allocator2&gt;
bool regex_match(const basic_string&lt;charT, ST, SA&gt;&amp; s, bool regex_match(const basic_string&lt;charT, ST, SA&gt;&amp; s,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator2&gt;&amp; e,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE> <A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE>

View File

@ -29,7 +29,7 @@
<H3><A name="synopsis"></A>Synopsis</H3> <H3><A name="synopsis"></A>Synopsis</H3>
<PRE>#include &lt;<A href="../../../boost/regex.hpp">boost/regex.hpp</A>&gt; </PRE> <PRE>#include &lt;<A href="../../../boost/regex.hpp">boost/regex.hpp</A>&gt; </PRE>
<P>The algorithm regex_replace&nbsp;searches&nbsp;through&nbsp;a string finding <P>The algorithm regex_replace&nbsp;searches&nbsp;through&nbsp;a string finding
all the matches to the regular expression: for each match it then calls <A href="match_results.html"> all the matches to the regular expression: for each match it then calls <A href="match_results.html#format">
match_results::format</A> to format the string and sends the result to the match_results::format</A> to format the string and sends the result to the
output iterator. Sections of text that do not match are copied to the output output iterator. Sections of text that do not match are copied to the output
unchanged only if the <EM>flags</EM> parameter does not have the flag <A href="match_flag_type.html"> unchanged only if the <EM>flags</EM> parameter does not have the flag <A href="match_flag_type.html">
@ -37,39 +37,87 @@
is set then only the first occurrence is replaced rather than all is set then only the first occurrence is replaced rather than all
occurrences.&nbsp;<PRE>template &lt;class OutputIterator, class BidirectionalIterator, class traits, occurrences.&nbsp;<PRE>template &lt;class OutputIterator, class BidirectionalIterator, class traits,
class Allocator, class charT&gt; class Allocator, class charT&gt;
OutputIterator regex_replace(OutputIterator out, OutputIterator <A href="#f1">regex_replace</A>(OutputIterator out,
BidirectionalIterator first, BidirectionalIterator first,
BidirectionalIterator last, BidirectionalIterator last,
const basic_regex&lt;charT, traits, Allocator&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator&gt;&amp; e,
const basic_string&lt;charT&gt;&amp; fmt, const basic_string&lt;charT&gt;&amp; fmt,
match_flag_type flags = match_default); <A href="match_flag_type.html">match_flag_type flags = match_default</A>);
template &lt;class traits, class Allocator, class charT&gt; template &lt;class traits, class Allocator, class charT&gt;
basic_string&lt;charT&gt; regex_replace(const basic_string&lt;charT&gt;&amp; s, basic_string&lt;charT&gt; <A href="#f2">regex_replace</A>(const basic_string&lt;charT&gt;&amp; s,
const basic_regex&lt;charT, traits, Allocator&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator&gt;&amp; e,
const basic_string&lt;charT&gt;&amp; fmt, const basic_string&lt;charT&gt;&amp; fmt,
match_flag_type flags = match_default); <A href="match_flag_type.html">match_flag_type flags = match_default</A>);
</PRE> </PRE>
<H3><A name="description"></A>Description</H3> <H3><A name="description"></A>Description</H3>
<PRE>template &lt;class OutputIterator, class BidirectionalIterator, class traits, <PRE><A name=f1></A>template &lt;class OutputIterator, class BidirectionalIterator, class traits,
class Allocator, class charT&gt; class Allocator, class charT&gt;
OutputIterator regex_replace(OutputIterator out, OutputIterator regex_replace(OutputIterator out,
BidirectionalIterator first, BidirectionalIterator first,
BidirectionalIterator last, BidirectionalIterator last,
const basic_regex&lt;charT, traits, Allocator&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator&gt;&amp; e,
const basic_string&lt;charT&gt;&amp; fmt, const basic_string&lt;charT&gt;&amp; fmt,
match_flag_type flags = match_default);</PRE> <A href="match_flag_type.html">match_flag_type flags = match_default</A>);</PRE>
<P><B> Effects:</B> Finds all the non-overlapping matches <I>m</I> of type <CODE>match_results&lt;BidirectionalIterator&gt; <P>Enumerates all the occurences of expression <EM>e</EM> in the sequence [first,
</CODE>that occur within the sequence [first, last). If no such matches are last), replacing each occurence with the string that results by merging the
found and <CODE>!(flags &amp; format_no_copy)</CODE> then calls <CODE>std::copy(first, match found with the format string <EM>fmt</EM>, and copies the resulting
last, out)</CODE>. Otherwise, for each match found, if <CODE>!(flags &amp; string to <EM>out</EM>.&nbsp;</P>
format_no_copy)</CODE> calls <CODE>std::copy(m.prefix().first, m.prefix().last, <P>If the flag format_no_copy is set in <EM>flags</EM> then unmatched sections of
out)</CODE>, and then calls <CODE>m.format(out, fmt, flags)</CODE>. Finally text are not copied to output.&nbsp;
if <CODE>!(flags &amp; format_no_copy)</CODE> calls <CODE>std::copy(last_m.suffix().first, </P>
last_m,suffix().last, out) </CODE>where <CODE>last_m</CODE> is a copy of the <P>If the flag format_first_only is set in <EM>flags</EM> then only the first
last match found. If <CODE>flags &amp; format_first_only</CODE> is non-zero occurence of <EM>e</EM> is replaced.&nbsp;
then only the first match found is replaced.</P> </P>
<P>The manner in which the format string <EM>fmt</EM> is interpretted, along with
the rules used&nbsp;for finding matches,&nbsp;are determined by the <A href="match_flag_type.html">
flags</A> set in <EM>flags</EM></P>
<P><B>Effects:</B> Constructs an
<SPAN class="spelle">regex_iterator</SPAN>
object:
</P>
<PRE><SPAN style="FONT-SIZE: 10pt">regex_iterator&lt;</SPAN><SPAN class=spelle><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">BidirectionalIterator</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt">, </SPAN><SPAN class=spelle><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">charT</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt">, traits, Allocator&gt; <BR> </SPAN><SPAN class=grame><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">i(</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt">first, last, e, flags)</SPAN>, </PRE>
<P>and uses
<SPAN class="spelle">
<I>i</I></SPAN>
to enumerate through all of the matches <I>m</I> of type
<SPAN class="spelle">
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">match_results</SPAN>
</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&lt;<SPAN class="spelle">BidirectionalIterator</SPAN>&gt; </SPAN>that
occur within the sequence [first, last).
</P>
<P>If no such matches are found
<SPAN class="grame">and </SPAN></P>
<PRE><SPAN class=grame></SPAN><SPAN class=grame><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">!</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">(flags &amp; <SPAN class=spelle>format_no_copy</SPAN>)</SPAN> </PRE>
<P>then calls
</P>
<PRE><SPAN class=spelle><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">std::copy</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">(first, last, out)</SPAN>. </PRE>
<P>Otherwise, for each match found,
<SPAN class="grame">if </SPAN></P>
<PRE><SPAN class=grame></SPAN><SPAN class=grame><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">!</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">(flags &amp; <SPAN class=spelle>format_no_copy</SPAN>)</SPAN> </PRE>
<P>calls
</P>
<PRE><SPAN class=spelle><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">std::copy</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">(<SPAN class=spelle>m.prefix</SPAN>().first, <SPAN class=spelle>m.prefix</SPAN>().last, out)</SPAN>, </PRE>
<P>and then calls
</P>
<PRE><SPAN class=spelle><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">m.format</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">(out, <SPAN class=spelle>fmt</SPAN>, flags)</SPAN>. </PRE>
<P>Finally
<SPAN class="grame">if </SPAN></P>
<PRE><SPAN class=grame></SPAN><SPAN class=grame><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">!</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">(flags &amp; <SPAN class=spelle>format_no_copy</SPAN>)</SPAN> </PRE>
<P>calls
</P>
<PRE><SPAN class=spelle><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">std::copy</SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">(<SPAN class=spelle>last_m.suffix</SPAN>().first, <SPAN class=spelle>last_m,suffix</SPAN>().last, out) </SPAN></PRE>
<P><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"></SPAN>where
<SPAN class="spelle">
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">last_m</SPAN>
</SPAN>
is a copy of the last match found.
</P>
<P>If
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">flags &amp;
<SPAN class="spelle">format_first_only</SPAN></SPAN>
is non-zero then only the first match found is replaced.</P>
<P><STRONG>Throws:</STRONG> <CODE>std::runtime_error</CODE> if the complexity of <P><STRONG>Throws:</STRONG> <CODE>std::runtime_error</CODE> if the complexity of
matching the expression against an N character string begins to exceed O(N<SUP>2</SUP>), matching the expression against an N character string begins to exceed O(N<SUP>2</SUP>),
or if the program runs out of stack space while matching the expression (if or if the program runs out of stack space while matching the expression (if
@ -78,11 +126,11 @@ OutputIterator regex_replace(OutputIterator out,
configured</A> in non-recursive mode).</P> configured</A> in non-recursive mode).</P>
<P><B> Returns:</B> <CODE>out</CODE>. <P><B> Returns:</B> <CODE>out</CODE>.
</P> </P>
<PRE>template &lt;class traits, class Allocator, class charT&gt; <PRE><A name=f2></A>template &lt;class traits, class Allocator, class charT&gt;
basic_string&lt;charT&gt; regex_replace(const basic_string&lt;charT&gt;&amp; s, basic_string&lt;charT&gt; regex_replace(const basic_string&lt;charT&gt;&amp; s,
const basic_regex&lt;charT, traits, Allocator&gt;&amp; e, const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator&gt;&amp; e,
const basic_string&lt;charT&gt;&amp; fmt, const basic_string&lt;charT&gt;&amp; fmt,
match_flag_type flags = match_default);</PRE> <A href="match_flag_type.html">match_flag_type flags = match_default</A>);</PRE>
<P><B> Effects:</B> Constructs an object <CODE>basic_string&lt;charT&gt; result</CODE>, <P><B> Effects:</B> Constructs an object <CODE>basic_string&lt;charT&gt; result</CODE>,
calls <CODE>regex_replace(back_inserter(result), s.begin(), s.end(), e, fmt, calls <CODE>regex_replace(back_inserter(result), s.begin(), s.end(), e, fmt,
flags)</CODE>, and then returns <CODE>result</CODE>. flags)</CODE>, and then returns <CODE>result</CODE>.

View File

@ -37,7 +37,7 @@
<PRE>template &lt;class BidirectionalIterator, <PRE>template &lt;class BidirectionalIterator,
class Allocator, class charT, class Allocator, class charT,
class traits, class Allocator2&gt; class traits, class Allocator2&gt;
bool regex_search(BidirectionalIterator first, BidirectionalIterator last, bool <A href="#f1">regex_search</A>(BidirectionalIterator first, BidirectionalIterator last,
<a href="match_results.html">match_results</a>&lt;BidirectionalIterator, Allocator&gt;&amp; m, <a href="match_results.html">match_results</a>&lt;BidirectionalIterator, Allocator&gt;&amp; m,
const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator2&gt;&amp; e, const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator2&gt;&amp; e,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default); <a href="match_flag_type.html">match_flag_type</a> flags = match_default);
@ -45,7 +45,7 @@ bool regex_search(BidirectionalIterator first, BidirectionalIterator last,
template &lt;class ST, class SA, template &lt;class ST, class SA,
class Allocator, class charT, class Allocator, class charT,
class traits, class Allocator2&gt; class traits, class Allocator2&gt;
bool regex_search(const basic_string&lt;charT, ST, SA&gt;&amp; s, bool <A href="#f2">regex_search</A>(const basic_string&lt;charT, ST, SA&gt;&amp; s,
<a href="match_results.html">match_results</a>&lt; <a href="match_results.html">match_results</a>&lt;
typename basic_string&lt;charT, ST,SA&gt;::const_iterator, typename basic_string&lt;charT, ST,SA&gt;::const_iterator,
Allocator&gt;&amp; m, Allocator&gt;&amp; m,
@ -54,32 +54,32 @@ bool regex_search(const basic_string&lt;charT, ST, SA&gt;&amp; s,
template&lt;class charT, class Allocator, class traits, template&lt;class charT, class Allocator, class traits,
class Allocator2&gt; class Allocator2&gt;
bool regex_search(const charT* str, bool <A href="#f3">regex_search</A>(const charT* str,
<a href="match_results.html">match_results</a>&lt;const charT*, Allocator&gt;&amp; m, <a href="match_results.html">match_results</a>&lt;const charT*, Allocator&gt;&amp; m,
const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator2&gt;&amp; e, const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator2&gt;&amp; e,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default); <a href="match_flag_type.html">match_flag_type</a> flags = match_default);
template &lt;class BidirectionalIterator, class Allocator, template &lt;class BidirectionalIterator, class Allocator,
class charT, class traits&gt; class charT, class traits&gt;
bool regex_search(BidirectionalIterator first, BidirectionalIterator last, bool <A href="#f4">regex_search</A>(BidirectionalIterator first, BidirectionalIterator last,
const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e, const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default); <a href="match_flag_type.html">match_flag_type</a> flags = match_default);
template &lt;class charT, class Allocator, template &lt;class charT, class Allocator,
class traits&gt; class traits&gt;
bool regex_search(const charT* str, bool <A href="#f5">regex_search</A>(const charT* str,
const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e, const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default); <a href="match_flag_type.html">match_flag_type</a> flags = match_default);
template&lt;class ST, class SA, template&lt;class ST, class SA,
class Allocator, class charT, class Allocator, class charT,
class traits&gt; class traits&gt;
bool regex_search(const basic_string&lt;charT, ST, SA&gt;&amp; s, bool <A href="#f6">regex_search</A>(const basic_string&lt;charT, ST, SA&gt;&amp; s,
const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e, const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default); <a href="match_flag_type.html">match_flag_type</a> flags = match_default);
</PRE> </PRE>
<H3><A name="description"></A>Description</H3> <H3><A name="description"></A>Description</H3>
<PRE>template &lt;class BidirectionalIterator, class Allocator, class charT, <PRE><A name=f1></A>template &lt;class BidirectionalIterator, class Allocator, class charT,
class traits, class Allocator2&gt; class traits, class Allocator2&gt;
bool regex_search(BidirectionalIterator first, BidirectionalIterator last, bool regex_search(BidirectionalIterator first, BidirectionalIterator last,
<a href="match_results.html">match_results</a>&lt;BidirectionalIterator, Allocator&gt;&amp; m, <a href="match_results.html">match_results</a>&lt;BidirectionalIterator, Allocator&gt;&amp; m,
@ -234,13 +234,13 @@ bool regex_search(BidirectionalIterator first, BidirectionalIterator last,
</TD></TR></TABLE> </TD></TR></TABLE>
</CENTER> </CENTER>
</DIV> </DIV>
<PRE>template &lt;class charT, class Allocator, class traits, class Allocator2&gt; <PRE><A name=f2></A>template &lt;class charT, class Allocator, class traits, class Allocator2&gt;
bool regex_search(const charT* str, <a href="match_results.html">match_results</a>&lt;const charT*, Allocator&gt;&amp; m, bool regex_search(const charT* str, <a href="match_results.html">match_results</a>&lt;const charT*, Allocator&gt;&amp; m,
const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator2&gt;&amp; e, const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator2&gt;&amp; e,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default);</PRE> <a href="match_flag_type.html">match_flag_type</a> flags = match_default);</PRE>
<P><B> Effects:</B> Returns the result of <CODE>regex_search(str, str + <P><B> Effects:</B> Returns the result of <CODE>regex_search(str, str +
char_traits&lt;charT&gt;::length(str), m, e, flags)</CODE>.</P> char_traits&lt;charT&gt;::length(str), m, e, flags)</CODE>.</P>
<PRE>template &lt;class ST, class SA, class Allocator, class charT, <PRE><A name=f3></A>template &lt;class ST, class SA, class Allocator, class charT,
class traits, class Allocator2&gt; class traits, class Allocator2&gt;
bool regex_search(const basic_string&lt;charT, ST, SA&gt;&amp; s, bool regex_search(const basic_string&lt;charT, ST, SA&gt;&amp; s,
<a href="match_results.html">match_results</a>&lt;typename basic_string&lt;charT, ST, SA&gt;::const_iterator, Allocator&gt;&amp; m, <a href="match_results.html">match_results</a>&lt;typename basic_string&lt;charT, ST, SA&gt;::const_iterator, Allocator&gt;&amp; m,
@ -248,7 +248,7 @@ bool regex_search(const basic_string&lt;charT, ST, SA&gt;&amp; s,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default);</PRE> <a href="match_flag_type.html">match_flag_type</a> flags = match_default);</PRE>
<P><B> Effects:</B> Returns the result of <CODE>regex_search(s.begin(), s.end(), m, <P><B> Effects:</B> Returns the result of <CODE>regex_search(s.begin(), s.end(), m,
e, flags)</CODE>.</P> e, flags)</CODE>.</P>
<PRE>template &lt;class iterator, class Allocator, class charT, <PRE><A name=f4></A>template &lt;class iterator, class Allocator, class charT,
class traits&gt; class traits&gt;
bool regex_search(iterator first, iterator last, bool regex_search(iterator first, iterator last,
const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e, const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e,
@ -256,13 +256,13 @@ bool regex_search(iterator first, iterator last,
<P><B> Effects:</B> Behaves "as if" by constructing an instance of <CODE><a href="match_results.html"> <P><B> Effects:</B> Behaves "as if" by constructing an instance of <CODE><a href="match_results.html">
match_results</a>&lt;</CODE>BidirectionalIterator<CODE>&gt; what</CODE>, match_results</a>&lt;</CODE>BidirectionalIterator<CODE>&gt; what</CODE>,
and then returning the result of <CODE>regex_search(first, last, what, e, flags)</CODE>.</P> and then returning the result of <CODE>regex_search(first, last, what, e, flags)</CODE>.</P>
<PRE>template &lt;class charT, class Allocator, class traits&gt; <PRE><A name=f5></A>template &lt;class charT, class Allocator, class traits&gt;
bool regex_search(const charT* str bool regex_search(const charT* str
const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e, const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default);</PRE> <a href="match_flag_type.html">match_flag_type</a> flags = match_default);</PRE>
<P><B> Effects:</B> Returns the result of <CODE>regex_search(str, str + <P><B> Effects:</B> Returns the result of <CODE>regex_search(str, str +
char_traits&lt;charT&gt;::length(str), e, flags)</CODE>.</P> char_traits&lt;charT&gt;::length(str), e, flags)</CODE>.</P>
<PRE>template &lt;class ST, class SA, class Allocator, class charT, <PRE><A name=f6></A>template &lt;class ST, class SA, class Allocator, class charT,
class traits&gt; class traits&gt;
bool regex_search(const basic_string&lt;charT, ST, SA&gt;&amp; s, bool regex_search(const basic_string&lt;charT, ST, SA&gt;&amp; s,
const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e, const <a href="basic_regex.html">basic_regex</a>&lt;charT, traits, Allocator&gt;&amp; e,

View File

@ -45,35 +45,35 @@ template &lt;class BidirectionalIterator,
class regex_token_iterator class regex_token_iterator
{ {
public: public:
typedef basic_regex&lt;charT, traits, Allocator&gt; regex_type; typedef <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator&gt; regex_type;
typedef basic_string&lt;charT&gt; value_type; typedef basic_string&lt;charT&gt; value_type;
typedef typename iterator_traits&lt;BidirectionalIterator&gt;::difference_type difference_type; typedef typename iterator_traits&lt;BidirectionalIterator&gt;::difference_type difference_type;
typedef const value_type* pointer; typedef const value_type* pointer;
typedef const value_type&amp; reference; typedef const value_type&amp; reference;
typedef std::forward_iterator_tag iterator_category; typedef std::forward_iterator_tag iterator_category;
regex_token_iterator(); <A href="#c1">regex_token_iterator</A>();
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re, <A href="#c2">regex_token_iterator</A>(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re,
int submatch = 0, match_flag_type m = match_default); int submatch = 0, <A href="match_flag_type.html">match_flag_type</A> m = match_default);
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re, <A href="#c3">regex_token_iterator</A>(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re,
const std::vector&lt;int&gt;&amp; submatches, match_flag_type m = match_default); const std::vector&lt;int&gt;&amp; submatches, match_flag_type m = match_default);
template &lt;std::size_t N&gt; template &lt;std::size_t N&gt;
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re, <A href="#c4">regex_token_iterator</A>(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re,
const int (&amp;submatches)[N], match_flag_type m = match_default); const int (&amp;submatches)[N], match_flag_type m = match_default);
regex_token_iterator(const regex_token_iterator&amp;); <A href="#c5">regex_token_iterator</A>(const regex_token_iterator&amp;);
regex_token_iterator&amp; operator=(const regex_token_iterator&amp;); regex_token_iterator&amp; <A href="#o1">operator</A>=(const regex_token_iterator&amp;);
bool operator==(const regex_token_iterator&amp;); bool <A href="#o2">operator</A>==(const regex_token_iterator&amp;)const;
bool operator!=(const regex_token_iterator&amp;); bool <A href="#o3">operator</A>!=(const regex_token_iterator&amp;)const;
const value_type&amp; operator*(); const value_type&amp; <A href="#o4">operator</A>*()const;
const value_type* operator-&gt;(); const value_type* <A href="#o5">operator</A>-&gt;()const;
regex_token_iterator&amp; operator++(); regex_token_iterator&amp; <A href="#o6">operator</A>++();
regex_token_iterator operator++(int); regex_token_iterator <A href="#o7">operator</A>++(int);
}; };
</PRE> </PRE>
<H3><A name="description"></A>Description</H3> <H3><A name="description"></A>Description</H3>
<PRE>regex_token_iterator();</PRE> <PRE><A name=c1></A>regex_token_iterator();</PRE>
<P><B> Effects:</B> constructs an end of sequence iterator.</P> <P><B> Effects:</B> constructs an end of sequence iterator.</P>
<PRE>regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re, <PRE><A name=c2></A>regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re,
int submatch = 0, match_flag_type m = match_default);</PRE> int submatch = 0, match_flag_type m = match_default);</PRE>
<P><B> Preconditions: </B><CODE>!re.empty()</CODE>.</P> <P><B> Preconditions: </B><CODE>!re.empty()</CODE>.</P>
<P><B> Effects:</B> constructs a regex_token_iterator that will enumerate one <P><B> Effects:</B> constructs a regex_token_iterator that will enumerate one
@ -88,7 +88,7 @@ public:
Boost.regex is <A href="configuration.html">configured</A> in recursive mode), Boost.regex is <A href="configuration.html">configured</A> in recursive mode),
or if the matcher exhausts it's permitted memory allocation (if Boost.regex is <A href="configuration.html"> or if the matcher exhausts it's permitted memory allocation (if Boost.regex is <A href="configuration.html">
configured</A> in non-recursive mode).</P> configured</A> in non-recursive mode).</P>
<PRE>regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re, <PRE><A name=c3></A>regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re,
const std::vector&lt;int&gt;&amp; submatches, match_flag_type m = match_default);</PRE> const std::vector&lt;int&gt;&amp; submatches, match_flag_type m = match_default);</PRE>
<P><B> Preconditions:</B> <CODE>submatches.size() &amp;&amp; !re.empty()</CODE>.</P> <P><B> Preconditions:</B> <CODE>submatches.size() &amp;&amp; !re.empty()</CODE>.</P>
<P><B> Effects:</B> constructs a regex_token_iterator that will enumerate <EM>submatches.size()</EM> <P><B> Effects:</B> constructs a regex_token_iterator that will enumerate <EM>submatches.size()</EM>
@ -106,7 +106,7 @@ public:
Boost.regex is <A href="configuration.html">configured</A> in recursive mode), Boost.regex is <A href="configuration.html">configured</A> in recursive mode),
or if the matcher exhausts it's permitted memory allocation (if Boost.regex is <A href="configuration.html"> or if the matcher exhausts it's permitted memory allocation (if Boost.regex is <A href="configuration.html">
configured</A> in non-recursive mode).</P> configured</A> in non-recursive mode).</P>
<PRE>template &lt;std::size_t N&gt; <PRE><A name=c4></A>template &lt;std::size_t N&gt;
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re, regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re,
const int (&amp;submatches)[R], match_flag_type m = match_default);</PRE> const int (&amp;submatches)[R], match_flag_type m = match_default);</PRE>
<P><B> Preconditions: </B><CODE>!re.empty()</CODE>.</P> <P><B> Preconditions: </B><CODE>!re.empty()</CODE>.</P>
@ -126,25 +126,25 @@ regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const reg
Boost.regex is <A href="configuration.html">configured</A> in recursive mode), Boost.regex is <A href="configuration.html">configured</A> in recursive mode),
or if the matcher exhausts it's permitted memory allocation (if Boost.regex is <A href="configuration.html"> or if the matcher exhausts it's permitted memory allocation (if Boost.regex is <A href="configuration.html">
configured</A> in non-recursive mode).</P> configured</A> in non-recursive mode).</P>
<PRE>regex_token_iterator(const regex_token_iterator&amp; that);</PRE> <PRE><A name=c5></A>regex_token_iterator(const regex_token_iterator&amp; that);</PRE>
<P><B> Effects: </B>constructs a copy of <CODE>that</CODE>.</P> <P><B> Effects: </B>constructs a copy of <CODE>that</CODE>.</P>
<P><B> Postconditions:</B> <CODE>*this == that</CODE>.</P> <P><B> Postconditions:</B> <CODE>*this == that</CODE>.</P>
<PRE>regex_token_iterator&amp; operator=(const regex_token_iterator&amp; that);</PRE> <PRE><A name=o1></A>regex_token_iterator&amp; operator=(const regex_token_iterator&amp; that);</PRE>
<P><B> Effects: </B>sets <CODE>*this</CODE> to be equal to&nbsp;<CODE>that</CODE>.</P> <P><B> Effects: </B>sets <CODE>*this</CODE> to be equal to&nbsp;<CODE>that</CODE>.</P>
<P><B> Postconditions:</B> <CODE>*this == that</CODE>.</P> <P><B> Postconditions:</B> <CODE>*this == that</CODE>.</P>
<PRE>bool operator==(const regex_token_iterator&amp;);</PRE> <PRE><A name=o2></A>bool operator==(const regex_token_iterator&amp;)const;</PRE>
<P> <P>
<B>Effects: </B>returns true if *this is the same position as that.</P> <B>Effects: </B>returns true if *this is the same position as that.</P>
<PRE>bool operator!=(const regex_token_iterator&amp;);</PRE> <PRE><A name=o3></A>bool operator!=(const regex_token_iterator&amp;)const;</PRE>
<P> <P>
<B>Effects: </B>returns <CODE>!(*this == that)</CODE>.</P> <B>Effects: </B>returns <CODE>!(*this == that)</CODE>.</P>
<PRE>const value_type&amp; operator*();</PRE> <PRE><A name=o4></A>const value_type&amp; operator*()const;</PRE>
<P> <P>
<B>Effects: </B>returns the current string being enumerated.</P> <B>Effects: </B>returns the current string being enumerated.</P>
<PRE>const value_type* operator-&gt;();</PRE> <PRE><A name=o5></A>const value_type* operator-&gt;()const;</PRE>
<P> <P>
<B>Effects: </B>returns <CODE>&amp;(*this)</CODE>.</P> <B>Effects: </B>returns <CODE>&amp;(*this)</CODE>.</P>
<PRE>regex_token_iterator&amp; operator++();</PRE> <PRE><A name=o6></A>regex_token_iterator&amp; operator++();</PRE>
<P> <P>
<B>Effects: </B>Moves on to the next string to be enumerated.</P> <B>Effects: </B>Moves on to the next string to be enumerated.</P>
<P><STRONG>Throws:</STRONG> <CODE>std::runtime_error</CODE> if the complexity of <P><STRONG>Throws:</STRONG> <CODE>std::runtime_error</CODE> if the complexity of
@ -155,7 +155,7 @@ regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const reg
configured</A> in non-recursive mode).</P> configured</A> in non-recursive mode).</P>
<B> <B>
<P> <P>
Returns:</B><CODE> *this</CODE>.</P><PRE>regex_token_iterator&amp; operator++(int);</PRE> Returns:</B><CODE> *this</CODE>.</P><PRE><A name=o7></A>regex_token_iterator&amp; operator++(int);</PRE>
<P><B> Effects:</B> constructs a copy <CODE>result</CODE> of <CODE>*this</CODE>, <P><B> Effects:</B> constructs a copy <CODE>result</CODE> of <CODE>*this</CODE>,
then calls <CODE>++(*this)</CODE>.</P> then calls <CODE>++(*this)</CODE>.</P>
<P><B> Returns:</B> <CODE>result</CODE>.<A name="examples"></A> <P><B> Returns:</B> <CODE>result</CODE>.<A name="examples"></A>

View File

@ -38,6 +38,9 @@
<P>Objects of type <EM>sub_match</EM> may only obtained by subscripting an object <P>Objects of type <EM>sub_match</EM> may only obtained by subscripting an object
of type <EM><A href="match_results.html">match_results</A></EM> of type <EM><A href="match_results.html">match_results</A></EM>
. .
<P>Objects of type <EM>sub_match</EM> may be compared to objects of type <EM>std::basic_string</EM>,
or <EM>const charT*</EM> or <EM>const charT</EM>
.
<P>When the marked sub-expression denoted by an object of type sub_match&lt;&gt; <P>When the marked sub-expression denoted by an object of type sub_match&lt;&gt;
participated in a regular expression match then member <CODE>matched</CODE> evaluates participated in a regular expression match then member <CODE>matched</CODE> evaluates
to true, and members <CODE>first</CODE> and <CODE>second</CODE> denote the to true, and members <CODE>first</CODE> and <CODE>second</CODE> denote the
@ -61,154 +64,197 @@ public:
typedef typename iterator_traits&lt;BidirectionalIterator&gt;::difference_type difference_type; typedef typename iterator_traits&lt;BidirectionalIterator&gt;::difference_type difference_type;
typedef BidirectionalIterator iterator; typedef BidirectionalIterator iterator;
bool matched; bool <A href="#m1">matched</A>;
difference_type length()const; difference_type <A href="#m2">length</A>()const;
operator basic_string&lt;value_type&gt;()const; operator <A href="#m3">basic_string</A>&lt;value_type&gt;()const;
basic_string&lt;value_type&gt; str()const; basic_string&lt;value_type&gt; <A href="#m4">str</A>()const;
int compare(const sub_match&amp; s)const; int <A href="#m5">compare</A>(const sub_match&amp; s)const;
int compare(const basic_string&lt;value_type&gt;&amp; s)const; int <A href="#m6">compare</A>(const basic_string&lt;value_type&gt;&amp; s)const;
int compare(const value_type* s)const; int <A href="#m7">compare</A>(const value_type* s)const;
}; };
//
// comparisons to another sub_match:
//
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o11">operator</A> == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o12">operator</A> != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o13">operator</A> &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o14">operator</A> &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o15">operator</A> &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o16">operator</A> &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
//
// comparisons to a basic_string:
//
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator == (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs, bool <A href="#o21">operator</A> == (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator != (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs, bool <A href="#o22">operator</A> != (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &lt; (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs, bool <A href="#o23">operator</A> &lt; (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &gt; (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs, bool <A href="#o24">operator</A> &gt; (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &gt;= (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs, bool <A href="#o25">operator</A> &gt;= (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &lt;= (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs, bool <A href="#o26">operator</A> &lt;= (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o31">operator</A> == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs); const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o32">operator</A> != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs); const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o33">operator</A> &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs); const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o34">operator</A> &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs); const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o35">operator</A> &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs); const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);
template &lt;class BidirectionalIterator, class traits, class Allocator&gt; template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o36">operator</A> &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs); const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);
//
// comparisons to a pointer to a character array:
//
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator == (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool <A href="#o41">operator</A> == (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator != (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool <A href="#o42">operator</A> != (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &lt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool <A href="#o43">operator</A> &lt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &gt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool <A href="#o44">operator</A> &gt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool <A href="#o45">operator</A> &gt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool <A href="#o46">operator</A> &lt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o51">operator</A> == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o52">operator</A> != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o53">operator</A> &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o54">operator</A> &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o55">operator</A> &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o56">operator</A> &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs);
//
// comparisons to a single character:
//
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator == (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool <A href="#o61">operator</A> == (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator != (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool <A href="#o62">operator</A> != (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &lt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool <A href="#o63">operator</A> &lt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &gt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool <A href="#o64">operator</A> &gt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool <A href="#o65">operator</A> &gt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool <A href="#o66">operator</A> &lt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o71">operator</A> == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o72">operator</A> != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o73">operator</A> &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o74">operator</A> &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o75">operator</A> &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs);
template &lt;class BidirectionalIterator&gt; template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool <A href="#o76">operator</A> &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs);
//
// addition operators:
//
template &lt;class RandomAccessIterator, class traits, class Allocator&gt;
std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type, traits, Allocator&gt;
<A href="#o81">operator</A> + (const std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type, traits, Allocator&gt;&amp; s,
const sub_match&lt;RandomAccessIterator&gt;&amp; m);
template &lt;class RandomAccessIterator, class traits, class Allocator&gt;
std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type, traits, Allocator&gt;
<A href="#o82">operator</A> + (const sub_match&lt;RandomAccessIterator&gt;&amp; m,
const std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type, traits, Allocator&gt;&amp; s);
template &lt;class RandomAccessIterator&gt; std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type&gt;
<A href="#o83">operator</A> + (typename iterator_traits&lt;RandomAccessIterator&gt;::value_type const* s,
const sub_match&lt;RandomAccessIterator&gt;&amp; m);
template &lt;class RandomAccessIterator&gt; std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type&gt;
<A href="#o84">operator</A> + (const sub_match&lt;RandomAccessIterator&gt;&amp; m,
typename iterator_traits&lt;RandomAccessIterator&gt;::value_type const * s);
template &lt;class RandomAccessIterator&gt;
std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type&gt;
<A href="#o85">operator</A> + (typename iterator_traits&lt;RandomAccessIterator&gt;::value_type const&amp; s,
const sub_match&lt;RandomAccessIterator&gt;&amp; m);
template &lt;class RandomAccessIterator&gt;
std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type&gt;
<A href="#o86">operator</A> + (const sub_match&lt;RandomAccessIterator&gt;&amp; m,
typename iterator_traits&lt;RandomAccessIterator&gt;::value_type const&amp; s);
template &lt;class RandomAccessIterator&gt;
std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type&gt;
<A href="#o87">operator</A> + (const sub_match&lt;RandomAccessIterator&gt;&amp; m1,
const sub_match&lt;RandomAccessIterator&gt;&amp; m2);
//
// stream inserter:
//
template &lt;class charT, class traits, class BidirectionalIterator&gt; template &lt;class charT, class traits, class BidirectionalIterator&gt;
basic_ostream&lt;charT, traits&gt;&amp; basic_ostream&lt;charT, traits&gt;&amp;
operator &lt;&lt; (basic_ostream&lt;charT, traits&gt;&amp; os, <A href="#oi">operator</A> &lt;&lt; (basic_ostream&lt;charT, traits&gt;&amp; os,
const sub_match&lt;BidirectionalIterator&gt;&amp; m); const sub_match&lt;BidirectionalIterator&gt;&amp; m);
} // namespace boost</PRE> } // namespace boost</PRE>
@ -225,188 +271,278 @@ basic_ostream&lt;charT, traits&gt;&amp;
<P>An iterator denoting the position of the start of the match.</P> <P>An iterator denoting the position of the start of the match.</P>
<PRE>iterator second</PRE> <PRE>iterator second</PRE>
<P>An iterator denoting the position of the end of the match.</P> <P>An iterator denoting the position of the end of the match.</P>
<PRE>bool matched</PRE> <PRE><A name=m1></A>bool matched</PRE>
<P>A Boolean value denoting whether this sub-expression participated in the match.</P> <P>A Boolean value denoting whether this sub-expression participated in the match.</P>
<PRE>static difference_type length();</PRE> <PRE><A name=m2></A>static difference_type length();</PRE>
<P>
<P> <B> <B>Effects: </B>returns the length of this matched sub-expression, or 0 if this
Effects: </B>returns <CODE>(matched ? 0 : distance(first, second))</CODE>.</P><PRE>operator basic_string&lt;value_type&gt;()const;</PRE> sub-expression was not matched: <CODE>matched ? distance(first, second) : 0)</CODE>.</P>
<PRE><A name=m3></A>operator basic_string&lt;value_type&gt;()const;</PRE>
<P> <B> <P>
Effects: </B>returns <CODE>(matched ? basic_string&lt;value_type&gt;(first, <B>Effects: </B>converts *this into a string: returns <CODE>(matched ?
second) : basic_string&lt;value_type&gt;()).</P></CODE><PRE>basic_string&lt;value_type&gt; str()const;</PRE> basic_string&lt;value_type&gt;(first, second) :
basic_string&lt;value_type&gt;()).</P>
<P><B> </CODE><PRE><A name=m4></A>basic_string&lt;value_type&gt; str()const;</PRE>
Effects: </B>returns <CODE>(matched ? basic_string&lt;value_type&gt;(first, <P><B> Effects: </B>returns a string representation of *this:&nbsp; <CODE>(matched ?
second) : basic_string&lt;value_type&gt;())</CODE>.</P><PRE>int compare(const sub_match&amp; s)const;</PRE> basic_string&lt;value_type&gt;(first, second) :
basic_string&lt;value_type&gt;())</CODE>.</P>
<P> <B> <PRE><A name=m5></A>int compare(const sub_match&amp; s)const;</PRE>
Effects: </B>returns <CODE>str().compare(s.str())</CODE>.</P><PRE>int compare(const basic_string&lt;value_type&gt;&amp; s)const;</PRE> <P>
<B>Effects: </B>performs a lexical comparison to <EM>s</EM>: returns <CODE>str().compare(s.str())</CODE>.</P>
<P><B> <PRE><A name=m6></A>int compare(const basic_string&lt;value_type&gt;&amp; s)const;</PRE>
Effects: </B>returns <CODE>str().compare(s)</CODE>.</P><PRE>int compare(const value_type* s)const;</PRE> <P><B> Effects: </B>compares *this to the string s: returns <CODE>str().compare(s)</CODE>.</P>
<PRE><A name=m7></A>int compare(const value_type* s)const;</PRE>
<P> <B> <P>
Effects: </B>returns <CODE>str().compare(s)</CODE>.</P> <B>Effects:<B></B> </B>compares *this to the null-terminated string <EM>s</EM>:<B>&nbsp;</B>returns
<CODE>str().compare(s)</CODE>.</P>
<H4> <H4>
sub_match non-member operators</H4> sub_match non-member operators</H4>
<PRE>template &lt;class BidirectionalIterator&gt; <H5>Comparisons against self</H5>
<PRE><A name=o11></A>template &lt;class BidirectionalIterator&gt;
bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.compare(rhs) == 0</CODE>.</P>
Effects: </B>returns <CODE>lhs.compare(rhs) == 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o12></A>template &lt;class BidirectionalIterator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.compare(rhs) != 0</CODE>.</P>
Effects: </B>returns <CODE>lhs.compare(rhs) != 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o13></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.compare(rhs) &lt; 0</CODE>.</P>
Effects: </B>returns <CODE>lhs.compare(rhs) &lt; 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o14></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P><B> Effects: </B>returns <CODE>lhs.compare(rhs) &lt;= 0</CODE>.</P>
<P><B> <PRE><A name=o15></A>template &lt;class BidirectionalIterator&gt;
Effects: </B>returns <CODE>lhs.compare(rhs) &lt;= 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.compare(rhs) &gt;= 0</CODE>.</P>
Effects: </B>returns <CODE>lhs.compare(rhs) &gt;= 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o16></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.compare(rhs) &gt; 0</CODE>.</P>
Effects: </B>returns <CODE>lhs.compare(rhs) &gt; 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <H5>Comparisons with std::basic_string</H5>
<pre><A name=o21></A>
template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator == (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits,
Allocator&gt;&amp; lhs, const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);
</pre>
<P><B>Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P>
<PRE><A name=o22></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator != (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P>
<PRE><A name=o23></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &lt; (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs&nbsp;&lt; rhs.str()</CODE>.</P>
<PRE><A name=o24></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &gt; (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs&nbsp;&gt; rhs.str()</CODE>.</P>
<PRE><A name=o25></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &gt;= (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs &gt;= rhs.str()</CODE>.</P>
<PRE><A name=o26></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &lt;= (const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs &lt;= rhs.str()</CODE>.</P>
<PRE><A name=o31></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P>
<PRE><A name=o32></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P>
<PRE><A name=o33></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs.str()&nbsp;&lt; rhs</CODE>.</P>
<PRE><A name=o34></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs.str()&nbsp;&gt; rhs</CODE>.</P>
<PRE><A name=o35></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs.str() &gt;= rhs</CODE>.</P>
<PRE><A name=o36></A>template &lt;class BidirectionalIterator, class traits, class Allocator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const std::basic_string&lt;iterator_traits&lt;BidirectionalIterator&gt;::value_type, traits, Allocator&gt;&amp; rhs);</PRE>
<P><B>Effects: </B>returns <CODE>lhs.str() &lt;= rhs</CODE>.</P>
<H5>Comparisons with null-terminated strings</H5>
<PRE><A name=o41></A>template &lt;class BidirectionalIterator&gt;
bool operator == (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool operator == (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o42></A>template &lt;class BidirectionalIterator&gt;
bool operator != (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool operator != (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE></A><A name=o43></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool operator &lt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs &lt; rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs &lt; rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o44></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool operator &gt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs &gt; rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs &gt; rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o45></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool operator &gt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs &gt;= rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs &gt;= rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o46></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs, bool operator &lt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs &lt;= rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs &lt;= rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o51></A>template &lt;class BidirectionalIterator&gt;
bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o52></A>template &lt;class BidirectionalIterator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o53></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() &lt; rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() &lt; rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o54></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() &gt; rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() &gt; rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o55></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() &gt;= rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() &gt;= rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o56></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() &lt;= rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() &lt;= rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <H5>Comparisons with a single character</H5>
<PRE><A name=o61></A>template &lt;class BidirectionalIterator&gt;
bool operator == (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool operator == (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o62></A>template &lt;class BidirectionalIterator&gt;
bool operator != (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool operator != (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o63></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool operator &lt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs &lt; rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs &lt; rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o64></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool operator &gt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs &gt; rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs &gt; rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o65></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool operator &gt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs &gt;= rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs &gt;= rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o66></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs, bool operator &lt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs &lt;= rhs.str()</CODE>.</P>
Effects: </B>returns <CODE>lhs &lt;= rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o71></A>template &lt;class BidirectionalIterator&gt;
bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o72></A>template &lt;class BidirectionalIterator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o73></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() &lt; rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() &lt; rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o74></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() &gt; rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() &gt; rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o75></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() &gt;= rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() &gt;= rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt; <PRE><A name=o76></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs, bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE> typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>lhs.str() &lt;= rhs</CODE>.</P>
Effects: </B>returns <CODE>lhs.str() &lt;= rhs</CODE>.</P><PRE>template &lt;class charT, class traits, class BidirectionalIterator&gt; <h5>Addition operators</h5>
<P>The addition operators for sub_match allow you to add a sub_match to any type
to which you can add a std::string and obtain a new string as the result.</P>
<PRE><A name=o81></A>template &lt;class RandomAccessIterator, class traits, class Allocator&gt;
std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type, traits, Allocator&gt;
operator + (const std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type, traits, Allocator&gt;&amp; s,
const sub_match&lt;RandomAccessIterator&gt;&amp; m); </PRE>
<P><B>Effects: </B>returns <CODE>s + m.str()</CODE>.</P>
<PRE><A name=o82></A>template &lt;class RandomAccessIterator, class traits, class Allocator&gt;
std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type, traits, Allocator&gt;
operator + (const sub_match&lt;RandomAccessIterator&gt;&amp; m,
const std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type, traits, Allocator&gt;&amp; s); </PRE>
<P><B>Effects: </B>returns <CODE>m.str() + s</CODE>.</P>
<PRE><A name=o83></A>template &lt;class RandomAccessIterator&gt; std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type&gt;
operator + (typename iterator_traits&lt;RandomAccessIterator&gt;::value_type const* s,
const sub_match&lt;RandomAccessIterator&gt;&amp; m); </PRE>
<P><B>Effects: </B>returns <CODE>s + m.str()</CODE>.</P>
<PRE><A name=o84></A>template &lt;class RandomAccessIterator&gt; std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type&gt;
operator + (const sub_match&lt;RandomAccessIterator&gt;&amp; m,
typename iterator_traits&lt;RandomAccessIterator&gt;::value_type const * s);</PRE>
<P><B>Effects: </B>returns <CODE>m.str() + s</CODE>.</P>
<PRE><A name=o85></A>template &lt;class RandomAccessIterator&gt;
std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type&gt;
operator + (typename iterator_traits&lt;RandomAccessIterator&gt;::value_type const&amp; s,
const sub_match&lt;RandomAccessIterator&gt;&amp; m); </PRE>
<P><B>Effects: </B>returns <CODE>s + m.str()</CODE>.</P>
<PRE><A name=o86></A>template &lt;class RandomAccessIterator&gt;
std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type&gt;
operator + (const sub_match&lt;RandomAccessIterator&gt;&amp; m,
typename iterator_traits&lt;RandomAccessIterator&gt;::value_type const&amp; s); </PRE>
<P><B>Effects: </B>returns <CODE>m.str() + s</CODE>.</P>
<PRE><A name=o87></A>template &lt;class RandomAccessIterator&gt;
std::basic_string&lt;typename iterator_traits&lt;RandomAccessIterator&gt;::value_type&gt;
operator + (const sub_match&lt;RandomAccessIterator&gt;&amp; m1,
const sub_match&lt;RandomAccessIterator&gt;&amp; m2);</PRE>
<P><B>Effects: </B>returns&nbsp;<CODE>m1.str() + m2.str()</CODE>.</P>
<h5>Stream inserter</h5>
<PRE><A name=oi></A>template &lt;class charT, class traits, class BidirectionalIterator&gt;
basic_ostream&lt;charT, traits&gt;&amp; basic_ostream&lt;charT, traits&gt;&amp;
operator &lt;&lt; (basic_ostream&lt;charT, traits&gt;&amp; os operator &lt;&lt; (basic_ostream&lt;charT, traits&gt;&amp; os
const sub_match&lt;BidirectionalIterator&gt;&amp; m);</PRE> const sub_match&lt;BidirectionalIterator&gt;&amp; m);</PRE>
<P>
<P> <B> <B>Effects: </B>returns <CODE>(os &lt;&lt; m.str())</CODE>.
Effects: </B>returns <CODE>(os &lt;&lt; m.str())</CODE>.
<HR> <HR>
<p>Revised <p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan --> <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
@ -422,5 +558,3 @@ basic_ostream&lt;charT, traits&gt;&amp;
for any purpose. It is provided "as is" without express or implied warranty.</I></P> for any purpose. It is provided "as is" without express or implied warranty.</I></P>
</body> </body>
</html> </html>

View File

@ -23,6 +23,11 @@
</TABLE> </TABLE>
</P> </P>
<HR> <HR>
<P>The regex library is thread safe when Boost is: you can verify that Boost is in
thread safe mode by checking to see if BOOST_HAS_THREADS is defined: this macro
is set automatically by the config system when threading support is turned on
in your compiler.
</P>
<P>Class <A href="basic_regex.html">basic_regex</A>&lt;&gt; and its typedefs regex <P>Class <A href="basic_regex.html">basic_regex</A>&lt;&gt; and its typedefs regex
and wregex are thread safe, in that compiled regular expressions can safely be and wregex are thread safe, in that compiled regular expressions can safely be
shared between threads. The matching algorithms <A href="regex_match.html">regex_match</A>, shared between threads. The matching algorithms <A href="regex_match.html">regex_match</A>,
@ -65,4 +70,3 @@
for any purpose. It is provided "as is" without express or implied warranty.</I></P> for any purpose. It is provided "as is" without express or implied warranty.</I></P>
</body> </body>
</html> </html>