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

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

View File

@ -28,16 +28,19 @@
<UL>
<LI>
Completely rewritten pattern matching code - it is now up to 10 times faster
than before.</LI>
than before.
<LI>
Reorganized documentation.</LI>
Reorganized documentation.
<LI>
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>
Added regex_iterator and regex_token_iterator.</LI>
Added regex_iterator and regex_token_iterator.
<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>
<HR>
<P></P>
@ -55,4 +58,3 @@
for any purpose. It is provided "as is" without express or implied warranty.</I></P>
</body>
</html>

View File

@ -62,7 +62,7 @@
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
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)
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++
@ -93,8 +93,9 @@
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
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
like this to provide the format conversions:</P>
algorithm<A href="regex_replace.html"> regex_replace</A>, for our credit card
example we can write two algorithms like this to provide the format
conversions:</P>
<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");
<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::wstring::const_iterator&gt; wsmatch;
}</PRE>
<P>The algorithms <A href="regex_search.html">regex_search</A> and <A href="regex_grep.html">
regex_grep</A> (i.e. finding all matches in a string) make use of
match_results to report what matched.</P>
<P>The algorithms <A href="regex_search.html">regex_search</A> and&nbsp;<A href="regex_match.html">regex_match</A>
make use of match_results to report what matched; the difference between these
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,
any bidirectional iterator type can be searched, allowing for the possibility
of seamlessly searching almost any kind of data.
</P>
<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_format</A> takes the result of a match and a format string, and
produces a new string by merging the two.</P>
<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 <A href="match_results.html">match_results</A>
class has a format member that takes the result of a match and a format string,
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
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,
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>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
@ -162,7 +172,7 @@ std::string human_readable_card_number(<B>const</B> std::string s)
17 May 2003
<!--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-<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan -->2003<!--webbot bot="Timestamp" endspan i-checksum="39359" --></I></P>
<P><I><EFBFBD> Copyright <a href="mailto:jm@regex.fsnet.co.uk">John Maddock</a>&nbsp;1998-<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan --> 2003<!--webbot bot="Timestamp" endspan i-checksum="39359" --></I></P>
<P align="left"><I>Permission to use, copy, modify, distribute and sell this software
and its documentation for any purpose is hereby granted without fee, provided
that the above copyright notice appear in all copies and that both that
@ -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>
</body>
</html>

View File

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

View File

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

View File

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

View File

@ -42,40 +42,39 @@ template &lt;class BidirectionalIterator,
class regex_iterator
{
public:
typedef basic_regex&lt;charT, traits, Allocator&gt; regex_type;
typedef match_results&lt;BidirectionalIterator&gt; value_type;
typedef <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator&gt; regex_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 const value_type* pointer;
typedef const value_type&amp; reference;
typedef std::forward_iterator_tag iterator_category;
regex_iterator();
regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
<A href="#c1">regex_iterator</A>();
<A href="#c2">regex_iterator</A>(BidirectionalIterator a, BidirectionalIterator b,
const regex_type&amp; re,
match_flag_type m = match_default);
regex_iterator(const regex_iterator&amp;);
regex_iterator&amp; operator=(const regex_iterator&amp;);
bool operator==(const regex_iterator&amp;);
bool operator!=(const regex_iterator&amp;);
const value_type&amp; operator*();
const value_type* operator-&gt;();
regex_iterator&amp; operator++();
regex_iterator operator++(int);
<A href="match_flag_type.html">match_flag_type</A> m = match_default);
<A href="#c3">regex_iterator</A>(const regex_iterator&amp;);
regex_iterator&amp; <A href="#o1">operator</A>=(const regex_iterator&amp;);
bool <A href="#o2">operator</A>==(const regex_iterator&amp;)const;
bool <A href="#o3">operator</A>!=(const regex_iterator&amp;)const;
const value_type&amp; <A href="#o4">operator</A>*()const;
const value_type* <A href="#o5">operator</A>-&gt;()const;
regex_iterator&amp; <A href="#o6">operator</A>++();
regex_iterator <A href="#o7">operator</A>++(int);
};
</pre>
<h3><a name="description"></a>Description</h3>
<p>A regex_iterator is constructed from a pair of iterators, and enumerates all
occurrences of a regular expression within that iterator range.</p>
<pre>
<pre><A name=c1></A>
regex_iterator();
</pre>
<b></b>
<p><b>Effects:</b> constructs an end of sequence regex_iterator.</p>
<pre>
regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
<pre><A name=c2></A>regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
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>
<b></b>
<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),
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>
<pre>
<pre><A name=c3></A>
regex_iterator(const regex_iterator&amp; that);
</pre>
<b></b>
<p><b>Effects:</b> constructs a copy of <code>that</code>.</p>
<b></b>
<p><b>Postconditions:</b> <code>*this == that</code>.</p>
<pre>
<pre><A name=o1></A>
regex_iterator&amp; operator=(const regex_iterator&amp;);
</pre>
<b></b>
<p><b>Effects:</b> sets&nbsp;<code>*this</code> equal to those in <code>that</code>.</p>
<b></b>
<p><b>Postconditions:</b> <code>*this == that</code>.</p>
<pre>
bool operator==(const regex_iterator&amp; that);
<pre><A name=o2></A>
bool operator==(const regex_iterator&amp; that)const;
</pre>
<b></b>
<p><b>Effects:</b> returns true if *this is equal to that.</p>
<pre>
bool operator!=(const regex_iterator&amp;);
<pre><A name=o3></A>
bool operator!=(const regex_iterator&amp;)const;
</pre>
<b></b>
<p><b>Effects:</b> returns <code>!(*this == that)</code>.</p>
<pre>
const value_type&amp; operator*();
<pre><A name=o4></A>
const value_type&amp; operator*()const;
</pre>
<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,
@ -159,7 +158,8 @@ const value_type&amp; operator*();
<p>(*it).prefix().last</p>
</td>
<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>
</tr>
<tr>
@ -167,7 +167,8 @@ const value_type&amp; operator*();
<p>(*it).prefix().matched</p>
</td>
<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>
</tr>
<tr>
@ -175,7 +176,8 @@ const value_type&amp; operator*();
<p>(*it).suffix().first</p>
</td>
<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>
</tr>
<tr>
@ -191,7 +193,8 @@ const value_type&amp; operator*();
<p>(*it).suffix().matched</p>
</td>
<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>
</tr>
<tr>
@ -259,12 +262,12 @@ const value_type&amp; operator*();
</table>
<br>
<br>
<pre>
const value_type* operator-&gt;();
<pre><A name=o5></A>
const value_type* operator-&gt;()const;
</pre>
<b></b>
<p><b>Effects:</b> returns <code>&amp;(*this)</code>.</p>
<pre>
<pre><A name=o6></A>
regex_iterator&amp; operator++();
</pre>
<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>
<b></b>
<p><b>Returns:</b> <code>*this</code>.</p>
<pre>
<pre><A name=o7></A>
regex_iterator operator++(int);
</pre>
<b></b>

View File

@ -31,47 +31,53 @@
</dl>
<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>
<P>The algorithm regex _match determines whether a given regular expression
matches a given sequence denoted by a pair of bidirectional-iterators, the
algorithm is defined as follows, <STRONG>note that the result is true only if the
expression matches the whole of the input sequence</STRONG>, the main use of
<P>
The algorithm regex _match determines whether a given regular expression
matches all of a given character sequence denoted by a pair of
bidirectional-iterators, the algorithm is defined as follows, the main use of
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,
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,
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);
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,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);
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,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);
template &lt;class ST, class SA, class Allocator, class charT,
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,
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);
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,
<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;
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,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);
</PRE>
<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;
bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
<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
is matched</A> against the character sequence. Returns true if such a match
exists, false otherwise.</P>
<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>), or
if the program runs out of stack space while matching the expression (if
<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>),
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),
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>
@ -231,20 +237,20 @@ bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
<P></P>
<DIV></DIV>
<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,
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>
<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>,
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,
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>
<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>
<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;
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,
@ -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>
<P><B> Effects:</B> Returns the result of <CODE>regex_match(s.begin(), s.end(), m, e,
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,
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>
<P><B> Effects:</B> Returns the result of <CODE>regex_match(str, str +
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,
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>

View File

@ -29,7 +29,7 @@
<H3><A name="synopsis"></A>Synopsis</H3>
<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
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
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">
@ -37,39 +37,87 @@
is set then only the first occurrence is replaced rather than all
occurrences.&nbsp;<PRE>template &lt;class OutputIterator, class BidirectionalIterator, class traits,
class Allocator, class charT&gt;
OutputIterator regex_replace(OutputIterator out,
OutputIterator <A href="#f1">regex_replace</A>(OutputIterator out,
BidirectionalIterator first,
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,
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;
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,
basic_string&lt;charT&gt; <A href="#f2">regex_replace</A>(const basic_string&lt;charT&gt;&amp; s,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator&gt;&amp; e,
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>
<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;
OutputIterator regex_replace(OutputIterator out,
BidirectionalIterator first,
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,
match_flag_type flags = match_default);</PRE>
<P><B> Effects:</B> Finds all the non-overlapping matches <I>m</I> of type <CODE>match_results&lt;BidirectionalIterator&gt;
</CODE>that occur within the sequence [first, last). If no such matches are
found and <CODE>!(flags &amp; format_no_copy)</CODE> then calls <CODE>std::copy(first,
last, out)</CODE>. Otherwise, for each match found, if <CODE>!(flags &amp;
format_no_copy)</CODE> calls <CODE>std::copy(m.prefix().first, m.prefix().last,
out)</CODE>, and then calls <CODE>m.format(out, fmt, flags)</CODE>. Finally
if <CODE>!(flags &amp; format_no_copy)</CODE> calls <CODE>std::copy(last_m.suffix().first,
last_m,suffix().last, out) </CODE>where <CODE>last_m</CODE> is a copy of the
last match found. If <CODE>flags &amp; format_first_only</CODE> is non-zero
then only the first match found is replaced.</P>
<A href="match_flag_type.html">match_flag_type flags = match_default</A>);</PRE>
<P>Enumerates all the occurences of expression <EM>e</EM> in the sequence [first,
last), replacing each occurence with the string that results by merging the
match found with the format string <EM>fmt</EM>, and copies the resulting
string to <EM>out</EM>.&nbsp;</P>
<P>If the flag format_no_copy is set in <EM>flags</EM> then unmatched sections of
text are not copied to output.&nbsp;
</P>
<P>If the flag format_first_only is set in <EM>flags</EM> then only the first
occurence of <EM>e</EM> is replaced.&nbsp;
</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
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
@ -78,11 +126,11 @@ OutputIterator regex_replace(OutputIterator out,
configured</A> in non-recursive mode).</P>
<P><B> Returns:</B> <CODE>out</CODE>.
</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,
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,
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>,
calls <CODE>regex_replace(back_inserter(result), s.begin(), s.end(), e, fmt,
flags)</CODE>, and then returns <CODE>result</CODE>.

View File

@ -37,7 +37,7 @@
<PRE>template &lt;class BidirectionalIterator,
class Allocator, class charT,
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,
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);
@ -45,7 +45,7 @@ bool regex_search(BidirectionalIterator first, BidirectionalIterator last,
template &lt;class ST, class SA,
class Allocator, class charT,
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;
typename basic_string&lt;charT, ST,SA&gt;::const_iterator,
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,
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,
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);
template &lt;class BidirectionalIterator, class Allocator,
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,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default);
template &lt;class charT, class Allocator,
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,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default);
template&lt;class ST, class SA,
class Allocator, class charT,
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,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default);
</PRE>
<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;
bool regex_search(BidirectionalIterator first, BidirectionalIterator last,
<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>
</CENTER>
</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,
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>
<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>
<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;
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,
@ -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>
<P><B> Effects:</B> Returns the result of <CODE>regex_search(s.begin(), s.end(), m,
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;
bool regex_search(iterator first, iterator last,
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">
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>
<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
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>
<P><B> Effects:</B> Returns the result of <CODE>regex_search(str, str +
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;
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,

View File

@ -45,35 +45,35 @@ template &lt;class BidirectionalIterator,
class regex_token_iterator
{
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 typename iterator_traits&lt;BidirectionalIterator&gt;::difference_type difference_type;
typedef const value_type* pointer;
typedef const value_type&amp; reference;
typedef std::forward_iterator_tag iterator_category;
regex_token_iterator();
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re,
int submatch = 0, match_flag_type m = match_default);
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re,
<A href="#c1">regex_token_iterator</A>();
<A href="#c2">regex_token_iterator</A>(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re,
int submatch = 0, <A href="match_flag_type.html">match_flag_type</A> m = match_default);
<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);
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);
regex_token_iterator(const regex_token_iterator&amp;);
regex_token_iterator&amp; operator=(const regex_token_iterator&amp;);
bool operator==(const regex_token_iterator&amp;);
bool operator!=(const regex_token_iterator&amp;);
const value_type&amp; operator*();
const value_type* operator-&gt;();
regex_token_iterator&amp; operator++();
regex_token_iterator operator++(int);
<A href="#c5">regex_token_iterator</A>(const regex_token_iterator&amp;);
regex_token_iterator&amp; <A href="#o1">operator</A>=(const regex_token_iterator&amp;);
bool <A href="#o2">operator</A>==(const regex_token_iterator&amp;)const;
bool <A href="#o3">operator</A>!=(const regex_token_iterator&amp;)const;
const value_type&amp; <A href="#o4">operator</A>*()const;
const value_type* <A href="#o5">operator</A>-&gt;()const;
regex_token_iterator&amp; <A href="#o6">operator</A>++();
regex_token_iterator <A href="#o7">operator</A>++(int);
};
</PRE>
<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>
<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>
<P><B> Preconditions: </B><CODE>!re.empty()</CODE>.</P>
<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),
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>
<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>
<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>
@ -106,7 +106,7 @@ public:
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">
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,
const int (&amp;submatches)[R], match_flag_type m = match_default);</PRE>
<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),
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>
<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> 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> 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>
<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>
<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>
<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>
<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>
<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
@ -155,7 +155,7 @@ regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const reg
configured</A> in non-recursive mode).</P>
<B>
<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>,
then calls <CODE>++(*this)</CODE>.</P>
<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
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;
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
@ -61,154 +64,197 @@ public:
typedef typename iterator_traits&lt;BidirectionalIterator&gt;::difference_type difference_type;
typedef BidirectionalIterator iterator;
bool matched;
bool <A href="#m1">matched</A>;
difference_type length()const;
operator basic_string&lt;value_type&gt;()const;
basic_string&lt;value_type&gt; str()const;
difference_type <A href="#m2">length</A>()const;
operator <A href="#m3">basic_string</A>&lt;value_type&gt;()const;
basic_string&lt;value_type&gt; <A href="#m4">str</A>()const;
int compare(const sub_match&amp; s)const;
int compare(const basic_string&lt;value_type&gt;&amp; s)const;
int compare(const value_type* s)const;
int <A href="#m5">compare</A>(const sub_match&amp; s)const;
int <A href="#m6">compare</A>(const basic_string&lt;value_type&gt;&amp; s)const;
int <A href="#m7">compare</A>(const value_type* s)const;
};
//
// comparisons to another sub_match:
//
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);
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);
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);
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);
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);
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);
//
// comparisons to a basic_string:
//
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
//
// comparisons to a pointer to a character array:
//
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
//
// comparisons to a single character:
//
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
//
// 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;
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);
} // 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>
<PRE>iterator second</PRE>
<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>
<PRE>static difference_type length();</PRE>
<P> <B>
Effects: </B>returns <CODE>(matched ? 0 : distance(first, second))</CODE>.</P><PRE>operator basic_string&lt;value_type&gt;()const;</PRE>
<P> <B>
Effects: </B>returns <CODE>(matched ? basic_string&lt;value_type&gt;(first,
second) : basic_string&lt;value_type&gt;()).</P></CODE><PRE>basic_string&lt;value_type&gt; str()const;</PRE>
<P><B>
Effects: </B>returns <CODE>(matched ? basic_string&lt;value_type&gt;(first,
second) : basic_string&lt;value_type&gt;())</CODE>.</P><PRE>int compare(const sub_match&amp; s)const;</PRE>
<P> <B>
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>returns <CODE>str().compare(s)</CODE>.</P><PRE>int compare(const value_type* s)const;</PRE>
<P> <B>
Effects: </B>returns <CODE>str().compare(s)</CODE>.</P>
<PRE><A name=m2></A>static difference_type length();</PRE>
<P>
<B>Effects: </B>returns the length of this matched sub-expression, or 0 if this
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>Effects: </B>converts *this into a string: returns <CODE>(matched ?
basic_string&lt;value_type&gt;(first, second) :
basic_string&lt;value_type&gt;()).</P>
</CODE><PRE><A name=m4></A>basic_string&lt;value_type&gt; str()const;</PRE>
<P><B> Effects: </B>returns a string representation of *this:&nbsp; <CODE>(matched ?
basic_string&lt;value_type&gt;(first, second) :
basic_string&lt;value_type&gt;())</CODE>.</P>
<PRE><A name=m5></A>int compare(const sub_match&amp; s)const;</PRE>
<P>
<B>Effects: </B>performs a lexical comparison to <EM>s</EM>: returns <CODE>str().compare(s.str())</CODE>.</P>
<PRE><A name=m6></A>int compare(const basic_string&lt;value_type&gt;&amp; 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>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>
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,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.compare(rhs) == 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.compare(rhs) == 0</CODE>.</P>
<PRE><A name=o12></A>template &lt;class BidirectionalIterator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.compare(rhs) != 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.compare(rhs) != 0</CODE>.</P>
<PRE><A name=o13></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.compare(rhs) &lt; 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.compare(rhs) &lt; 0</CODE>.</P>
<PRE><A name=o14></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P><B>
Effects: </B>returns <CODE>lhs.compare(rhs) &lt;= 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P><B> Effects: </B>returns <CODE>lhs.compare(rhs) &lt;= 0</CODE>.</P>
<PRE><A name=o15></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.compare(rhs) &gt;= 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.compare(rhs) &gt;= 0</CODE>.</P>
<PRE><A name=o16></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.compare(rhs) &gt; 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.compare(rhs) &gt; 0</CODE>.</P>
<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,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P>
<PRE><A name=o42></A>template &lt;class BidirectionalIterator&gt;
bool operator != (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P>
<PRE></A><A name=o43></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs &lt; rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs &lt; rhs.str()</CODE>.</P>
<PRE><A name=o44></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs &gt; rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs &gt; rhs.str()</CODE>.</P>
<PRE><A name=o45></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs &gt;= rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs &gt;= rhs.str()</CODE>.</P>
<PRE><A name=o46></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs &lt;= rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs &lt;= rhs.str()</CODE>.</P>
<PRE><A name=o51></A>template &lt;class BidirectionalIterator&gt;
bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P>
<PRE><A name=o52></A>template &lt;class BidirectionalIterator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P>
<PRE><A name=o53></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() &lt; rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() &lt; rhs</CODE>.</P>
<PRE><A name=o54></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() &gt; rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() &gt; rhs</CODE>.</P>
<PRE><A name=o55></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() &gt;= rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() &gt;= rhs</CODE>.</P>
<PRE><A name=o56></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() &lt;= rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() &lt;= rhs</CODE>.</P>
<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,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P>
<PRE><A name=o62></A>template &lt;class BidirectionalIterator&gt;
bool operator != (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P>
<PRE><A name=o63></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs &lt; rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs &lt; rhs.str()</CODE>.</P>
<PRE><A name=o64></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs &gt; rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs &gt; rhs.str()</CODE>.</P>
<PRE><A name=o65></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs &gt;= rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs &gt;= rhs.str()</CODE>.</P>
<PRE><A name=o66></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs &lt;= rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs &lt;= rhs.str()</CODE>.</P>
<PRE><A name=o71></A>template &lt;class BidirectionalIterator&gt;
bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P>
<PRE><A name=o72></A>template &lt;class BidirectionalIterator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P>
<PRE><A name=o73></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() &lt; rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() &lt; rhs</CODE>.</P>
<PRE><A name=o74></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() &gt; rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() &gt; rhs</CODE>.</P>
<PRE><A name=o75></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() &gt;= rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() &gt;= rhs</CODE>.</P>
<PRE><A name=o76></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() &lt;= rhs</CODE>.</P><PRE>template &lt;class charT, class traits, class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() &lt;= rhs</CODE>.</P>
<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;
operator &lt;&lt; (basic_ostream&lt;charT, traits&gt;&amp; os
const sub_match&lt;BidirectionalIterator&gt;&amp; m);</PRE>
<P> <B>
Effects: </B>returns <CODE>(os &lt;&lt; m.str())</CODE>.
<P>
<B>Effects: </B>returns <CODE>(os &lt;&lt; m.str())</CODE>.
<HR>
<p>Revised
<!--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>
</body>
</html>

View File

@ -23,6 +23,11 @@
</TABLE>
</P>
<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
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>,
@ -65,4 +70,3 @@
for any purpose. It is provided "as is" without express or implied warranty.</I></P>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -28,16 +28,19 @@
<UL>
<LI>
Completely rewritten pattern matching code - it is now up to 10 times faster
than before.</LI>
than before.
<LI>
Reorganized documentation.</LI>
Reorganized documentation.
<LI>
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>
Added regex_iterator and regex_token_iterator.</LI>
Added regex_iterator and regex_token_iterator.
<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>
<HR>
<P></P>
@ -55,4 +58,3 @@
for any purpose. It is provided "as is" without express or implied warranty.</I></P>
</body>
</html>

View File

@ -62,7 +62,7 @@
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
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)
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++
@ -93,8 +93,9 @@
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
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
like this to provide the format conversions:</P>
algorithm<A href="regex_replace.html"> regex_replace</A>, for our credit card
example we can write two algorithms like this to provide the format
conversions:</P>
<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");
<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::wstring::const_iterator&gt; wsmatch;
}</PRE>
<P>The algorithms <A href="regex_search.html">regex_search</A> and <A href="regex_grep.html">
regex_grep</A> (i.e. finding all matches in a string) make use of
match_results to report what matched.</P>
<P>The algorithms <A href="regex_search.html">regex_search</A> and&nbsp;<A href="regex_match.html">regex_match</A>
make use of match_results to report what matched; the difference between these
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,
any bidirectional iterator type can be searched, allowing for the possibility
of seamlessly searching almost any kind of data.
</P>
<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_format</A> takes the result of a match and a format string, and
produces a new string by merging the two.</P>
<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 <A href="match_results.html">match_results</A>
class has a format member that takes the result of a match and a format string,
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
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,
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>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
@ -162,7 +172,7 @@ std::string human_readable_card_number(<B>const</B> std::string s)
17 May 2003
<!--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-<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan -->2003<!--webbot bot="Timestamp" endspan i-checksum="39359" --></I></P>
<P><I><EFBFBD> Copyright <a href="mailto:jm@regex.fsnet.co.uk">John Maddock</a>&nbsp;1998-<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%Y" startspan --> 2003<!--webbot bot="Timestamp" endspan i-checksum="39359" --></I></P>
<P align="left"><I>Permission to use, copy, modify, distribute and sell this software
and its documentation for any purpose is hereby granted without fee, provided
that the above copyright notice appear in all copies and that both that
@ -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>
</body>
</html>

View File

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

View File

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

View File

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

View File

@ -42,40 +42,39 @@ template &lt;class BidirectionalIterator,
class regex_iterator
{
public:
typedef basic_regex&lt;charT, traits, Allocator&gt; regex_type;
typedef match_results&lt;BidirectionalIterator&gt; value_type;
typedef <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator&gt; regex_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 const value_type* pointer;
typedef const value_type&amp; reference;
typedef std::forward_iterator_tag iterator_category;
regex_iterator();
regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
<A href="#c1">regex_iterator</A>();
<A href="#c2">regex_iterator</A>(BidirectionalIterator a, BidirectionalIterator b,
const regex_type&amp; re,
match_flag_type m = match_default);
regex_iterator(const regex_iterator&amp;);
regex_iterator&amp; operator=(const regex_iterator&amp;);
bool operator==(const regex_iterator&amp;);
bool operator!=(const regex_iterator&amp;);
const value_type&amp; operator*();
const value_type* operator-&gt;();
regex_iterator&amp; operator++();
regex_iterator operator++(int);
<A href="match_flag_type.html">match_flag_type</A> m = match_default);
<A href="#c3">regex_iterator</A>(const regex_iterator&amp;);
regex_iterator&amp; <A href="#o1">operator</A>=(const regex_iterator&amp;);
bool <A href="#o2">operator</A>==(const regex_iterator&amp;)const;
bool <A href="#o3">operator</A>!=(const regex_iterator&amp;)const;
const value_type&amp; <A href="#o4">operator</A>*()const;
const value_type* <A href="#o5">operator</A>-&gt;()const;
regex_iterator&amp; <A href="#o6">operator</A>++();
regex_iterator <A href="#o7">operator</A>++(int);
};
</pre>
<h3><a name="description"></a>Description</h3>
<p>A regex_iterator is constructed from a pair of iterators, and enumerates all
occurrences of a regular expression within that iterator range.</p>
<pre>
<pre><A name=c1></A>
regex_iterator();
</pre>
<b></b>
<p><b>Effects:</b> constructs an end of sequence regex_iterator.</p>
<pre>
regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
<pre><A name=c2></A>regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
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>
<b></b>
<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),
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>
<pre>
<pre><A name=c3></A>
regex_iterator(const regex_iterator&amp; that);
</pre>
<b></b>
<p><b>Effects:</b> constructs a copy of <code>that</code>.</p>
<b></b>
<p><b>Postconditions:</b> <code>*this == that</code>.</p>
<pre>
<pre><A name=o1></A>
regex_iterator&amp; operator=(const regex_iterator&amp;);
</pre>
<b></b>
<p><b>Effects:</b> sets&nbsp;<code>*this</code> equal to those in <code>that</code>.</p>
<b></b>
<p><b>Postconditions:</b> <code>*this == that</code>.</p>
<pre>
bool operator==(const regex_iterator&amp; that);
<pre><A name=o2></A>
bool operator==(const regex_iterator&amp; that)const;
</pre>
<b></b>
<p><b>Effects:</b> returns true if *this is equal to that.</p>
<pre>
bool operator!=(const regex_iterator&amp;);
<pre><A name=o3></A>
bool operator!=(const regex_iterator&amp;)const;
</pre>
<b></b>
<p><b>Effects:</b> returns <code>!(*this == that)</code>.</p>
<pre>
const value_type&amp; operator*();
<pre><A name=o4></A>
const value_type&amp; operator*()const;
</pre>
<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,
@ -159,7 +158,8 @@ const value_type&amp; operator*();
<p>(*it).prefix().last</p>
</td>
<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>
</tr>
<tr>
@ -167,7 +167,8 @@ const value_type&amp; operator*();
<p>(*it).prefix().matched</p>
</td>
<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>
</tr>
<tr>
@ -175,7 +176,8 @@ const value_type&amp; operator*();
<p>(*it).suffix().first</p>
</td>
<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>
</tr>
<tr>
@ -191,7 +193,8 @@ const value_type&amp; operator*();
<p>(*it).suffix().matched</p>
</td>
<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>
</tr>
<tr>
@ -259,12 +262,12 @@ const value_type&amp; operator*();
</table>
<br>
<br>
<pre>
const value_type* operator-&gt;();
<pre><A name=o5></A>
const value_type* operator-&gt;()const;
</pre>
<b></b>
<p><b>Effects:</b> returns <code>&amp;(*this)</code>.</p>
<pre>
<pre><A name=o6></A>
regex_iterator&amp; operator++();
</pre>
<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>
<b></b>
<p><b>Returns:</b> <code>*this</code>.</p>
<pre>
<pre><A name=o7></A>
regex_iterator operator++(int);
</pre>
<b></b>

View File

@ -31,47 +31,53 @@
</dl>
<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>
<P>The algorithm regex _match determines whether a given regular expression
matches a given sequence denoted by a pair of bidirectional-iterators, the
algorithm is defined as follows, <STRONG>note that the result is true only if the
expression matches the whole of the input sequence</STRONG>, the main use of
<P>
The algorithm regex _match determines whether a given regular expression
matches all of a given character sequence denoted by a pair of
bidirectional-iterators, the algorithm is defined as follows, the main use of
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,
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,
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);
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,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);
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,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);
template &lt;class ST, class SA, class Allocator, class charT,
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,
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);
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,
<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;
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,
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);
</PRE>
<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;
bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
<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
is matched</A> against the character sequence. Returns true if such a match
exists, false otherwise.</P>
<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>), or
if the program runs out of stack space while matching the expression (if
<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>),
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),
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>
@ -231,20 +237,20 @@ bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
<P></P>
<DIV></DIV>
<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,
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>
<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>,
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,
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>
<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>
<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;
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,
@ -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>
<P><B> Effects:</B> Returns the result of <CODE>regex_match(s.begin(), s.end(), m, e,
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,
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>
<P><B> Effects:</B> Returns the result of <CODE>regex_match(str, str +
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,
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>

View File

@ -29,7 +29,7 @@
<H3><A name="synopsis"></A>Synopsis</H3>
<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
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
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">
@ -37,39 +37,87 @@
is set then only the first occurrence is replaced rather than all
occurrences.&nbsp;<PRE>template &lt;class OutputIterator, class BidirectionalIterator, class traits,
class Allocator, class charT&gt;
OutputIterator regex_replace(OutputIterator out,
OutputIterator <A href="#f1">regex_replace</A>(OutputIterator out,
BidirectionalIterator first,
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,
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;
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,
basic_string&lt;charT&gt; <A href="#f2">regex_replace</A>(const basic_string&lt;charT&gt;&amp; s,
const <A href="basic_regex.html">basic_regex</A>&lt;charT, traits, Allocator&gt;&amp; e,
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>
<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;
OutputIterator regex_replace(OutputIterator out,
BidirectionalIterator first,
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,
match_flag_type flags = match_default);</PRE>
<P><B> Effects:</B> Finds all the non-overlapping matches <I>m</I> of type <CODE>match_results&lt;BidirectionalIterator&gt;
</CODE>that occur within the sequence [first, last). If no such matches are
found and <CODE>!(flags &amp; format_no_copy)</CODE> then calls <CODE>std::copy(first,
last, out)</CODE>. Otherwise, for each match found, if <CODE>!(flags &amp;
format_no_copy)</CODE> calls <CODE>std::copy(m.prefix().first, m.prefix().last,
out)</CODE>, and then calls <CODE>m.format(out, fmt, flags)</CODE>. Finally
if <CODE>!(flags &amp; format_no_copy)</CODE> calls <CODE>std::copy(last_m.suffix().first,
last_m,suffix().last, out) </CODE>where <CODE>last_m</CODE> is a copy of the
last match found. If <CODE>flags &amp; format_first_only</CODE> is non-zero
then only the first match found is replaced.</P>
<A href="match_flag_type.html">match_flag_type flags = match_default</A>);</PRE>
<P>Enumerates all the occurences of expression <EM>e</EM> in the sequence [first,
last), replacing each occurence with the string that results by merging the
match found with the format string <EM>fmt</EM>, and copies the resulting
string to <EM>out</EM>.&nbsp;</P>
<P>If the flag format_no_copy is set in <EM>flags</EM> then unmatched sections of
text are not copied to output.&nbsp;
</P>
<P>If the flag format_first_only is set in <EM>flags</EM> then only the first
occurence of <EM>e</EM> is replaced.&nbsp;
</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
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
@ -78,11 +126,11 @@ OutputIterator regex_replace(OutputIterator out,
configured</A> in non-recursive mode).</P>
<P><B> Returns:</B> <CODE>out</CODE>.
</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,
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,
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>,
calls <CODE>regex_replace(back_inserter(result), s.begin(), s.end(), e, fmt,
flags)</CODE>, and then returns <CODE>result</CODE>.

View File

@ -37,7 +37,7 @@
<PRE>template &lt;class BidirectionalIterator,
class Allocator, class charT,
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,
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);
@ -45,7 +45,7 @@ bool regex_search(BidirectionalIterator first, BidirectionalIterator last,
template &lt;class ST, class SA,
class Allocator, class charT,
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;
typename basic_string&lt;charT, ST,SA&gt;::const_iterator,
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,
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,
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);
template &lt;class BidirectionalIterator, class Allocator,
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,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default);
template &lt;class charT, class Allocator,
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,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default);
template&lt;class ST, class SA,
class Allocator, class charT,
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,
<a href="match_flag_type.html">match_flag_type</a> flags = match_default);
</PRE>
<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;
bool regex_search(BidirectionalIterator first, BidirectionalIterator last,
<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>
</CENTER>
</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,
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>
<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>
<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;
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,
@ -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>
<P><B> Effects:</B> Returns the result of <CODE>regex_search(s.begin(), s.end(), m,
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;
bool regex_search(iterator first, iterator last,
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">
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>
<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
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>
<P><B> Effects:</B> Returns the result of <CODE>regex_search(str, str +
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;
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,

View File

@ -45,35 +45,35 @@ template &lt;class BidirectionalIterator,
class regex_token_iterator
{
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 typename iterator_traits&lt;BidirectionalIterator&gt;::difference_type difference_type;
typedef const value_type* pointer;
typedef const value_type&amp; reference;
typedef std::forward_iterator_tag iterator_category;
regex_token_iterator();
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re,
int submatch = 0, match_flag_type m = match_default);
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re,
<A href="#c1">regex_token_iterator</A>();
<A href="#c2">regex_token_iterator</A>(BidirectionalIterator a, BidirectionalIterator b, const regex_type&amp; re,
int submatch = 0, <A href="match_flag_type.html">match_flag_type</A> m = match_default);
<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);
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);
regex_token_iterator(const regex_token_iterator&amp;);
regex_token_iterator&amp; operator=(const regex_token_iterator&amp;);
bool operator==(const regex_token_iterator&amp;);
bool operator!=(const regex_token_iterator&amp;);
const value_type&amp; operator*();
const value_type* operator-&gt;();
regex_token_iterator&amp; operator++();
regex_token_iterator operator++(int);
<A href="#c5">regex_token_iterator</A>(const regex_token_iterator&amp;);
regex_token_iterator&amp; <A href="#o1">operator</A>=(const regex_token_iterator&amp;);
bool <A href="#o2">operator</A>==(const regex_token_iterator&amp;)const;
bool <A href="#o3">operator</A>!=(const regex_token_iterator&amp;)const;
const value_type&amp; <A href="#o4">operator</A>*()const;
const value_type* <A href="#o5">operator</A>-&gt;()const;
regex_token_iterator&amp; <A href="#o6">operator</A>++();
regex_token_iterator <A href="#o7">operator</A>++(int);
};
</PRE>
<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>
<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>
<P><B> Preconditions: </B><CODE>!re.empty()</CODE>.</P>
<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),
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>
<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>
<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>
@ -106,7 +106,7 @@ public:
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">
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,
const int (&amp;submatches)[R], match_flag_type m = match_default);</PRE>
<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),
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>
<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> 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> 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>
<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>
<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>
<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>
<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>
<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
@ -155,7 +155,7 @@ regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const reg
configured</A> in non-recursive mode).</P>
<B>
<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>,
then calls <CODE>++(*this)</CODE>.</P>
<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
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;
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
@ -61,154 +64,197 @@ public:
typedef typename iterator_traits&lt;BidirectionalIterator&gt;::difference_type difference_type;
typedef BidirectionalIterator iterator;
bool matched;
bool <A href="#m1">matched</A>;
difference_type length()const;
operator basic_string&lt;value_type&gt;()const;
basic_string&lt;value_type&gt; str()const;
difference_type <A href="#m2">length</A>()const;
operator <A href="#m3">basic_string</A>&lt;value_type&gt;()const;
basic_string&lt;value_type&gt; <A href="#m4">str</A>()const;
int compare(const sub_match&amp; s)const;
int compare(const basic_string&lt;value_type&gt;&amp; s)const;
int compare(const value_type* s)const;
int <A href="#m5">compare</A>(const sub_match&amp; s)const;
int <A href="#m6">compare</A>(const basic_string&lt;value_type&gt;&amp; s)const;
int <A href="#m7">compare</A>(const value_type* s)const;
};
//
// comparisons to another sub_match:
//
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);
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);
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);
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);
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);
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);
//
// comparisons to a basic_string:
//
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
//
// comparisons to a pointer to a character array:
//
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
//
// comparisons to a single character:
//
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
//
// 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;
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);
} // 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>
<PRE>iterator second</PRE>
<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>
<PRE>static difference_type length();</PRE>
<P> <B>
Effects: </B>returns <CODE>(matched ? 0 : distance(first, second))</CODE>.</P><PRE>operator basic_string&lt;value_type&gt;()const;</PRE>
<P> <B>
Effects: </B>returns <CODE>(matched ? basic_string&lt;value_type&gt;(first,
second) : basic_string&lt;value_type&gt;()).</P></CODE><PRE>basic_string&lt;value_type&gt; str()const;</PRE>
<P><B>
Effects: </B>returns <CODE>(matched ? basic_string&lt;value_type&gt;(first,
second) : basic_string&lt;value_type&gt;())</CODE>.</P><PRE>int compare(const sub_match&amp; s)const;</PRE>
<P> <B>
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>returns <CODE>str().compare(s)</CODE>.</P><PRE>int compare(const value_type* s)const;</PRE>
<P> <B>
Effects: </B>returns <CODE>str().compare(s)</CODE>.</P>
<PRE><A name=m2></A>static difference_type length();</PRE>
<P>
<B>Effects: </B>returns the length of this matched sub-expression, or 0 if this
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>Effects: </B>converts *this into a string: returns <CODE>(matched ?
basic_string&lt;value_type&gt;(first, second) :
basic_string&lt;value_type&gt;()).</P>
</CODE><PRE><A name=m4></A>basic_string&lt;value_type&gt; str()const;</PRE>
<P><B> Effects: </B>returns a string representation of *this:&nbsp; <CODE>(matched ?
basic_string&lt;value_type&gt;(first, second) :
basic_string&lt;value_type&gt;())</CODE>.</P>
<PRE><A name=m5></A>int compare(const sub_match&amp; s)const;</PRE>
<P>
<B>Effects: </B>performs a lexical comparison to <EM>s</EM>: returns <CODE>str().compare(s.str())</CODE>.</P>
<PRE><A name=m6></A>int compare(const basic_string&lt;value_type&gt;&amp; 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>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>
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,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.compare(rhs) == 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.compare(rhs) == 0</CODE>.</P>
<PRE><A name=o12></A>template &lt;class BidirectionalIterator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.compare(rhs) != 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.compare(rhs) != 0</CODE>.</P>
<PRE><A name=o13></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.compare(rhs) &lt; 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.compare(rhs) &lt; 0</CODE>.</P>
<PRE><A name=o14></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P><B>
Effects: </B>returns <CODE>lhs.compare(rhs) &lt;= 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P><B> Effects: </B>returns <CODE>lhs.compare(rhs) &lt;= 0</CODE>.</P>
<PRE><A name=o15></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.compare(rhs) &gt;= 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.compare(rhs) &gt;= 0</CODE>.</P>
<PRE><A name=o16></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs);</PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.compare(rhs) &gt; 0</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.compare(rhs) &gt; 0</CODE>.</P>
<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,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P>
<PRE><A name=o42></A>template &lt;class BidirectionalIterator&gt;
bool operator != (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P>
<PRE></A><A name=o43></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs &lt; rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs &lt; rhs.str()</CODE>.</P>
<PRE><A name=o44></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs &gt; rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs &gt; rhs.str()</CODE>.</P>
<PRE><A name=o45></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs &gt;= rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs &gt;= rhs.str()</CODE>.</P>
<PRE><A name=o46></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs &lt;= rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs &lt;= rhs.str()</CODE>.</P>
<PRE><A name=o51></A>template &lt;class BidirectionalIterator&gt;
bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P>
<PRE><A name=o52></A>template &lt;class BidirectionalIterator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P>
<PRE><A name=o53></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() &lt; rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() &lt; rhs</CODE>.</P>
<PRE><A name=o54></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() &gt; rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() &gt; rhs</CODE>.</P>
<PRE><A name=o55></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() &gt;= rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() &gt;= rhs</CODE>.</P>
<PRE><A name=o56></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const* rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() &lt;= rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() &lt;= rhs</CODE>.</P>
<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,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P>
<PRE><A name=o62></A>template &lt;class BidirectionalIterator&gt;
bool operator != (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P>
<PRE><A name=o63></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs &lt; rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs &lt; rhs.str()</CODE>.</P>
<PRE><A name=o64></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt; (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs &gt; rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs &gt; rhs.str()</CODE>.</P>
<PRE><A name=o65></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs &gt;= rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs &gt;= rhs.str()</CODE>.</P>
<PRE><A name=o66></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; lhs,
const sub_match&lt;BidirectionalIterator&gt;&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs &lt;= rhs.str()</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs &lt;= rhs.str()</CODE>.</P>
<PRE><A name=o71></A>template &lt;class BidirectionalIterator&gt;
bool operator == (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P>
<PRE><A name=o72></A>template &lt;class BidirectionalIterator&gt;
bool operator != (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P>
<PRE><A name=o73></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() &lt; rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() &lt; rhs</CODE>.</P>
<PRE><A name=o74></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt; (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() &gt; rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() &gt; rhs</CODE>.</P>
<PRE><A name=o75></A>template &lt;class BidirectionalIterator&gt;
bool operator &gt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() &gt;= rhs</CODE>.</P><PRE>template &lt;class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() &gt;= rhs</CODE>.</P>
<PRE><A name=o76></A>template &lt;class BidirectionalIterator&gt;
bool operator &lt;= (const sub_match&lt;BidirectionalIterator&gt;&amp; lhs,
typename iterator_traits&lt;BidirectionalIterator&gt;::value_type const&amp; rhs); </PRE>
<P> <B>
Effects: </B>returns <CODE>lhs.str() &lt;= rhs</CODE>.</P><PRE>template &lt;class charT, class traits, class BidirectionalIterator&gt;
<P>
<B>Effects: </B>returns <CODE>lhs.str() &lt;= rhs</CODE>.</P>
<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;
operator &lt;&lt; (basic_ostream&lt;charT, traits&gt;&amp; os
const sub_match&lt;BidirectionalIterator&gt;&amp; m);</PRE>
<P> <B>
Effects: </B>returns <CODE>(os &lt;&lt; m.str())</CODE>.
<P>
<B>Effects: </B>returns <CODE>(os &lt;&lt; m.str())</CODE>.
<HR>
<p>Revised
<!--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>
</body>
</html>

View File

@ -23,6 +23,11 @@
</TABLE>
</P>
<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
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>,
@ -65,4 +70,3 @@
for any purpose. It is provided "as is" without express or implied warranty.</I></P>
</body>
</html>