forked from boostorg/regex
Updated docs to include recent changes, and improve general quality.
[SVN r20443]
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -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">
|
||||
<regex.h></a> and <a href="http://www.opengroup.org/onlinepubs/7908799/xsh/nl_types.h.html">
|
||||
<nl_types.h></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> 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>; 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 tutorials on regular expressions can be <A href="http://etext.lib.virginia.edu/helpsheets/regex.html">
|
||||
found here</A> and <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">
|
||||
<regex.h></a> and <a href="http://www.opengroup.org/onlinepubs/7908799/xsh/nl_types.h.html">
|
||||
<nl_types.h></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> 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>
|
||||
|
@ -27,17 +27,20 @@
|
||||
<P>Boost 1.31.0.</P>
|
||||
<UL>
|
||||
<LI>
|
||||
Completely rewritten pattern matching code - it is now up to 10 times faster
|
||||
than before.</LI>
|
||||
Completely rewritten pattern matching code - it is now up to 10 times faster
|
||||
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>
|
||||
|
||||
|
@ -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<std::string::const_iterator> smatch;
|
||||
<STRONG>typedef</STRONG> match_results<std::wstring::const_iterator> 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 <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> 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> 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>
|
||||
|
||||
|
||||
|
||||
|
@ -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. 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" 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>© Copyright <a href="mailto:jm@regex.fsnet.co.uk">John
|
||||
Maddock</a> 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" 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> 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>
|
||||
|
||||
|
||||
|
@ -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 <<a href="../../../boost/regex.hpp">boost/regex.hpp</a>></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> . 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 <<a href="../../../boost/regex.hpp">boost/regex.hpp</a>></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> . 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 <class BidirectionalIterator,
|
||||
class Allocator = allocator<sub_match<BidirectionalIterator> >
|
||||
class match_results;
|
||||
@ -98,414 +78,354 @@ public:
|
||||
typedef basic_string<char_type> string_type;
|
||||
|
||||
// construct/copy/destroy:
|
||||
explicit match_results(const Allocator& a = Allocator());
|
||||
match_results(const match_results& m);
|
||||
match_results& operator=(const match_results& m);
|
||||
explicit <A href="#c1">match_results</A>(const Allocator& a = Allocator());
|
||||
<A href="#c2">match_results</A>(const match_results& m);
|
||||
<A href="#c3">match_results</A>& <A href="#c3">operator</A>=(const match_results& 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 <class OutputIterator>
|
||||
OutputIterator format(OutputIterator out,
|
||||
OutputIterator <A href="#m12">format</A>(OutputIterator out,
|
||||
const string_type& fmt,
|
||||
match_flag_type flags = format_default) const;
|
||||
string_type format(const string_type& fmt,
|
||||
string_type <A href="#m13">format</A>(const string_type& fmt,
|
||||
match_flag_type flags = format_default) const;
|
||||
|
||||
allocator_type get_allocator() const;
|
||||
void swap(match_results& that);
|
||||
allocator_type <A href="#m14">get_allocator</A>() const;
|
||||
void <A href="#m15">swap</A>(match_results& that);
|
||||
};
|
||||
|
||||
template <class BidirectionalIterator, class Allocator>
|
||||
bool operator == (const match_results<BidirectionalIterator, Allocator>& m1,
|
||||
bool <A href="#n1">operator</A> == (const match_results<BidirectionalIterator, Allocator>& m1,
|
||||
const match_results<BidirectionalIterator, Allocator>& m2);
|
||||
template <class BidirectionalIterator, class Allocator>
|
||||
bool operator != (const match_results<BidirectionalIterator, Allocator>& m1,
|
||||
bool <A href="#n2">operator</A> != (const match_results<BidirectionalIterator, Allocator>& m1,
|
||||
const match_results<BidirectionalIterator, Allocator>& m2);
|
||||
|
||||
template <class charT, class traits, class BidirectionalIterator, class Allocator>
|
||||
basic_ostream<charT, traits>&
|
||||
operator << (basic_ostream<charT, traits>& os,
|
||||
<A href="#n3">operator</A> << (basic_ostream<charT, traits>& os,
|
||||
const match_results<BidirectionalIterator, Allocator>& m);
|
||||
|
||||
template <class BidirectionalIterator, class Allocator>
|
||||
void swap(match_results<BidirectionalIterator, Allocator>& m1,
|
||||
void <A href="#n4">swap</A>(match_results<BidirectionalIterator, Allocator>& m1,
|
||||
match_results<BidirectionalIterator, Allocator>& 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& 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<charT>()</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</center>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<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<charT>()</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</center>
|
||||
<p> </p>
|
||||
<pre><A name=c2></A>
|
||||
match_results(const match_results& m);
|
||||
</pre>
|
||||
|
||||
<b></b>
|
||||
<p><b>Effects:</b> Constructs an object of class match_results, as
|
||||
a copy of m.</p>
|
||||
|
||||
<pre>
|
||||
<b></b>
|
||||
<p><b>Effects:</b> Constructs an object of class match_results, as a copy of m.</p>
|
||||
<pre><A name=c3></A>
|
||||
match_results& operator=(const match_results& 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 < 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 < 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 < 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 < m.size().</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</center>
|
||||
|
||||
<h4>match_results size</h4>
|
||||
|
||||
<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 < 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 < 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 < 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 < 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>
|
||||
<b></b>
|
||||
<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>
|
||||
<b></b>
|
||||
<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>
|
||||
<b></b>
|
||||
<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>
|
||||
<b></b>
|
||||
<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>
|
||||
<b></b>
|
||||
<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>
|
||||
<b></b>
|
||||
<p><b>Effects:</b> Returns sub-expression <EM>sub</EM> as a string: <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>
|
||||
<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. 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>
|
||||
<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><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>
|
||||
<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><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>
|
||||
<b></b>
|
||||
<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>
|
||||
<b></b>
|
||||
<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 <class OutputIterator>
|
||||
OutputIterator format(OutputIterator out,
|
||||
const string_type& 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>
|
||||
|
||||
<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>
|
||||
|
||||
<b></b>
|
||||
<p><b>Returns:</b> <i>out</i>.</p>
|
||||
|
||||
<pre>
|
||||
<b></b>
|
||||
<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>
|
||||
<b></b>
|
||||
<p><b>Returns:</b> <i>out</i>.</p>
|
||||
<pre><A name=m13></A>
|
||||
string_type format(const string_type& 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>
|
||||
<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><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>
|
||||
<b></b>
|
||||
<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& that);
|
||||
</pre>
|
||||
|
||||
<b></b>
|
||||
<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>
|
||||
|
||||
<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>© Copyright <a href="mailto:jm@regex.fsnet.co.uk">John
|
||||
Maddock</a> 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>
|
||||
<b></b>
|
||||
<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>
|
||||
<b></b>
|
||||
<p><b>Complexity:</b> constant time.</p>
|
||||
<h4>match_results non-members</h4>
|
||||
<PRE><A name=n1></A>template <class BidirectionalIterator, class Allocator>
|
||||
bool operator == (const match_results<BidirectionalIterator, Allocator>& m1,
|
||||
const match_results<BidirectionalIterator, Allocator>& m2);</PRE>
|
||||
<P><B>Effects:</B> Compares the two sequences for equality.</P>
|
||||
<PRE><A name=n2></A>template <class BidirectionalIterator, class Allocator>
|
||||
bool operator != (const match_results<BidirectionalIterator, Allocator>& m1,
|
||||
const match_results<BidirectionalIterator, Allocator>& m2);</PRE>
|
||||
<P><B>Effects:</B> Compares the two sequences for inequality.</P>
|
||||
<PRE><A name=n3></A>template <class charT, class traits, class BidirectionalIterator, class Allocator>
|
||||
basic_ostream<charT, traits>&
|
||||
operator << (basic_ostream<charT, traits>& os,
|
||||
const match_results<BidirectionalIterator, Allocator>& 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 << m.str();</code> Returns <EM>os</EM>..</P>
|
||||
<PRE><A name=n4></A>template <class BidirectionalIterator, class Allocator>
|
||||
void swap(match_results<BidirectionalIterator, Allocator>& m1,
|
||||
match_results<BidirectionalIterator, Allocator>& 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> 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>
|
||||
|
||||
|
||||
|
@ -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>
|
||||
|
@ -42,40 +42,39 @@ template <class BidirectionalIterator,
|
||||
class regex_iterator
|
||||
{
|
||||
public:
|
||||
typedef basic_regex<charT, traits, Allocator> regex_type;
|
||||
typedef match_results<BidirectionalIterator> value_type;
|
||||
typedef <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator> regex_type;
|
||||
typedef <A href="match_results.html">match_results</A><BidirectionalIterator> value_type;
|
||||
typedef typename iterator_traits<BidirectionalIterator>::difference_type difference_type;
|
||||
typedef const value_type* pointer;
|
||||
typedef const value_type& 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& re,
|
||||
match_flag_type m = match_default);
|
||||
regex_iterator(const regex_iterator&);
|
||||
regex_iterator& operator=(const regex_iterator&);
|
||||
bool operator==(const regex_iterator&);
|
||||
bool operator!=(const regex_iterator&);
|
||||
const value_type& operator*();
|
||||
const value_type* operator->();
|
||||
regex_iterator& 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&);
|
||||
regex_iterator& <A href="#o1">operator</A>=(const regex_iterator&);
|
||||
bool <A href="#o2">operator</A>==(const regex_iterator&)const;
|
||||
bool <A href="#o3">operator</A>!=(const regex_iterator&)const;
|
||||
const value_type& <A href="#o4">operator</A>*()const;
|
||||
const value_type* <A href="#o5">operator</A>->()const;
|
||||
regex_iterator& <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& 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& 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& operator=(const regex_iterator&);
|
||||
</pre>
|
||||
<b></b>
|
||||
<p><b>Effects:</b> sets <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& that);
|
||||
<pre><A name=o2></A>
|
||||
bool operator==(const regex_iterator& that)const;
|
||||
</pre>
|
||||
<b></b>
|
||||
<p><b>Effects:</b> returns true if *this is equal to that.</p>
|
||||
<pre>
|
||||
bool operator!=(const regex_iterator&);
|
||||
<pre><A name=o3></A>
|
||||
bool operator!=(const regex_iterator&)const;
|
||||
</pre>
|
||||
<b></b>
|
||||
<p><b>Effects:</b> returns <code>!(*this == that)</code>.</p>
|
||||
<pre>
|
||||
const value_type& operator*();
|
||||
<pre><A name=o4></A>
|
||||
const value_type& 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& 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& 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& 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& 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& operator*();
|
||||
</table>
|
||||
<br>
|
||||
<br>
|
||||
<pre>
|
||||
const value_type* operator->();
|
||||
<pre><A name=o5></A>
|
||||
const value_type* operator->()const;
|
||||
</pre>
|
||||
<b></b>
|
||||
<p><b>Effects:</b> returns <code>&(*this)</code>.</p>
|
||||
<pre>
|
||||
<pre><A name=o6></A>
|
||||
regex_iterator& operator++();
|
||||
</pre>
|
||||
<p><strong>Effects:</strong> moves the iterator to the next match in the
|
||||
@ -282,7 +285,7 @@ regex_iterator& 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>
|
||||
|
@ -31,47 +31,53 @@
|
||||
</dl>
|
||||
<H3><A name="synopsis"></A>Synopsis</H3>
|
||||
<PRE><A name=query_match></A>#include <<A href="../../../boost/regex.hpp">boost/regex.hpp</A>> </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
|
||||
this function is data input validation.
|
||||
<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. </STRONG> If you want to search for an expression
|
||||
somewhere within the sequence then use <A href="regex_search.html">regex_search</A>.
|
||||
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 <class BidirectionalIterator, class Allocator, class charT,
|
||||
class traits, class Allocator2>
|
||||
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><BidirectionalIterator, Allocator>& m,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator2>& e,
|
||||
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);
|
||||
|
||||
template <class BidirectionalIterator, class charT, class traits, class Allocator2>
|
||||
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><charT, traits, Allocator2>& e,
|
||||
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);
|
||||
|
||||
template <class charT, class Allocator, class traits, class Allocator2>
|
||||
bool regex_match(const charT* str, <A href="match_results.html">match_results</A><const charT*, Allocator>& m,
|
||||
bool <A href="#f3">regex_match</A>(const charT* str, <A href="match_results.html">match_results</A><const charT*, Allocator>& m,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator2>& e,
|
||||
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);
|
||||
|
||||
template <class ST, class SA, class Allocator, class charT,
|
||||
class traits, class Allocator2>
|
||||
bool regex_match(const basic_string<charT, ST, SA>& s,
|
||||
bool <A href="#f4">regex_match</A>(const basic_string<charT, ST, SA>& s,
|
||||
<A href="match_results.html">match_results</A><typename basic_string<charT, ST, SA>::const_iterator, Allocator>& m,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator2>& e,
|
||||
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);
|
||||
|
||||
template <class charT, class traits, class Allocator2>
|
||||
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><charT, traits, Allocator2>& e,
|
||||
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);
|
||||
|
||||
template <class ST, class SA, class charT, class traits, class Allocator2>
|
||||
bool regex_match(const basic_string<charT, ST, SA>& s,
|
||||
bool <A href="#f6">regex_match</A>(const basic_string<charT, ST, SA>& s,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator2>& e,
|
||||
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);
|
||||
</PRE>
|
||||
<H3><A name="description"></A>Description</H3>
|
||||
<PRE>template <class BidirectionalIterator, class Allocator, class charT,
|
||||
<PRE><A name=f1></A>template <class BidirectionalIterator, class Allocator, class charT,
|
||||
class traits, class Allocator2>
|
||||
bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
|
||||
<A href="match_results.html">match_results</A><BidirectionalIterator, Allocator>& 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> </PRE>
|
||||
<PRE>template <class BidirectionalIterator, class charT, class traits, class Allocator2>
|
||||
<PRE><A name=f2></A>template <class BidirectionalIterator, class charT, class traits, class Allocator2>
|
||||
bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator2>& 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><</CODE>BidirectionalIterator<CODE>> what</CODE>,
|
||||
and then returning the result of <CODE>regex_match(first, last, what, e, flags)</CODE>.</P>
|
||||
<PRE>template <class charT, class Allocator, class traits, class Allocator2>
|
||||
<PRE><A name=f3></A>template <class charT, class Allocator, class traits, class Allocator2>
|
||||
bool regex_match(const charT* str, <A href="match_results.html">match_results</A><const charT*, Allocator>& m,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator2>& 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<charT>::length(str), m, e, flags)</CODE>.</P>
|
||||
<PRE>template <class ST, class SA, class Allocator, class charT,
|
||||
<PRE><A name=f4></A>template <class ST, class SA, class Allocator, class charT,
|
||||
class traits, class Allocator2>
|
||||
bool regex_match(const basic_string<charT, ST, SA>& s,
|
||||
<A href="match_results.html">match_results</A><typename basic_string<charT, ST, SA>::const_iterator, Allocator>& m,
|
||||
@ -252,13 +258,13 @@ bool regex_match(const basic_string<charT, ST, SA>& 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 <class charT, class traits, class Allocator2>
|
||||
<PRE><A name=f5></A>template <class charT, class traits, class Allocator2>
|
||||
bool regex_match(const charT* str,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator2>& 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<charT>::length(str), e, flags)</CODE>.</P>
|
||||
<PRE>template <class ST, class SA, class charT, class traits, class Allocator2>
|
||||
<PRE><A name=f6></A>template <class ST, class SA, class charT, class traits, class Allocator2>
|
||||
bool regex_match(const basic_string<charT, ST, SA>& s,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator2>& e,
|
||||
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE>
|
||||
|
@ -29,7 +29,7 @@
|
||||
<H3><A name="synopsis"></A>Synopsis</H3>
|
||||
<PRE>#include <<A href="../../../boost/regex.hpp">boost/regex.hpp</A>> </PRE>
|
||||
<P>The algorithm regex_replace searches through 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. <PRE>template <class OutputIterator, class BidirectionalIterator, class traits,
|
||||
class Allocator, class charT>
|
||||
OutputIterator regex_replace(OutputIterator out,
|
||||
OutputIterator <A href="#f1">regex_replace</A>(OutputIterator out,
|
||||
BidirectionalIterator first,
|
||||
BidirectionalIterator last,
|
||||
const basic_regex<charT, traits, Allocator>& e,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator>& e,
|
||||
const basic_string<charT>& fmt,
|
||||
match_flag_type flags = match_default);
|
||||
<A href="match_flag_type.html">match_flag_type flags = match_default</A>);
|
||||
|
||||
template <class traits, class Allocator, class charT>
|
||||
basic_string<charT> regex_replace(const basic_string<charT>& s,
|
||||
const basic_regex<charT, traits, Allocator>& e,
|
||||
basic_string<charT> <A href="#f2">regex_replace</A>(const basic_string<charT>& s,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator>& e,
|
||||
const basic_string<charT>& 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 <class OutputIterator, class BidirectionalIterator, class traits,
|
||||
<PRE><A name=f1></A>template <class OutputIterator, class BidirectionalIterator, class traits,
|
||||
class Allocator, class charT>
|
||||
OutputIterator regex_replace(OutputIterator out,
|
||||
BidirectionalIterator first,
|
||||
BidirectionalIterator last,
|
||||
const basic_regex<charT, traits, Allocator>& e,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator>& e,
|
||||
const basic_string<charT>& 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<BidirectionalIterator>
|
||||
</CODE>that occur within the sequence [first, last). If no such matches are
|
||||
found and <CODE>!(flags & format_no_copy)</CODE> then calls <CODE>std::copy(first,
|
||||
last, out)</CODE>. Otherwise, for each match found, if <CODE>!(flags &
|
||||
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 & 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 & 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>. </P>
|
||||
<P>If the flag format_no_copy is set in <EM>flags</EM> then unmatched sections of
|
||||
text are not copied to output.
|
||||
</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.
|
||||
</P>
|
||||
<P>The manner in which the format string <EM>fmt</EM> is interpretted, along with
|
||||
the rules used for finding matches, 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<</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> <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'"><<SPAN class="spelle">BidirectionalIterator</SPAN>> </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 & <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 & <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 & <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 &
|
||||
<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 <class traits, class Allocator, class charT>
|
||||
<PRE><A name=f2></A>template <class traits, class Allocator, class charT>
|
||||
basic_string<charT> regex_replace(const basic_string<charT>& s,
|
||||
const basic_regex<charT, traits, Allocator>& e,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator>& e,
|
||||
const basic_string<charT>& 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<charT> result</CODE>,
|
||||
calls <CODE>regex_replace(back_inserter(result), s.begin(), s.end(), e, fmt,
|
||||
flags)</CODE>, and then returns <CODE>result</CODE>.
|
||||
|
@ -37,7 +37,7 @@
|
||||
<PRE>template <class BidirectionalIterator,
|
||||
class Allocator, class charT,
|
||||
class traits, class Allocator2>
|
||||
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><BidirectionalIterator, Allocator>& m,
|
||||
const <a href="basic_regex.html">basic_regex</a><charT, traits, Allocator2>& 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 <class ST, class SA,
|
||||
class Allocator, class charT,
|
||||
class traits, class Allocator2>
|
||||
bool regex_search(const basic_string<charT, ST, SA>& s,
|
||||
bool <A href="#f2">regex_search</A>(const basic_string<charT, ST, SA>& s,
|
||||
<a href="match_results.html">match_results</a><
|
||||
typename basic_string<charT, ST,SA>::const_iterator,
|
||||
Allocator>& m,
|
||||
@ -54,32 +54,32 @@ bool regex_search(const basic_string<charT, ST, SA>& s,
|
||||
|
||||
template<class charT, class Allocator, class traits,
|
||||
class Allocator2>
|
||||
bool regex_search(const charT* str,
|
||||
bool <A href="#f3">regex_search</A>(const charT* str,
|
||||
<a href="match_results.html">match_results</a><const charT*, Allocator>& m,
|
||||
const <a href="basic_regex.html">basic_regex</a><charT, traits, Allocator2>& e,
|
||||
<a href="match_flag_type.html">match_flag_type</a> flags = match_default);
|
||||
|
||||
template <class BidirectionalIterator, class Allocator,
|
||||
class charT, class traits>
|
||||
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><charT, traits, Allocator>& e,
|
||||
<a href="match_flag_type.html">match_flag_type</a> flags = match_default);
|
||||
|
||||
template <class charT, class Allocator,
|
||||
class traits>
|
||||
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><charT, traits, Allocator>& e,
|
||||
<a href="match_flag_type.html">match_flag_type</a> flags = match_default);
|
||||
|
||||
template<class ST, class SA,
|
||||
class Allocator, class charT,
|
||||
class traits>
|
||||
bool regex_search(const basic_string<charT, ST, SA>& s,
|
||||
bool <A href="#f6">regex_search</A>(const basic_string<charT, ST, SA>& s,
|
||||
const <a href="basic_regex.html">basic_regex</a><charT, traits, Allocator>& e,
|
||||
<a href="match_flag_type.html">match_flag_type</a> flags = match_default);
|
||||
</PRE>
|
||||
<H3><A name="description"></A>Description</H3>
|
||||
<PRE>template <class BidirectionalIterator, class Allocator, class charT,
|
||||
<PRE><A name=f1></A>template <class BidirectionalIterator, class Allocator, class charT,
|
||||
class traits, class Allocator2>
|
||||
bool regex_search(BidirectionalIterator first, BidirectionalIterator last,
|
||||
<a href="match_results.html">match_results</a><BidirectionalIterator, Allocator>& m,
|
||||
@ -234,13 +234,13 @@ bool regex_search(BidirectionalIterator first, BidirectionalIterator last,
|
||||
</TD></TR></TABLE>
|
||||
</CENTER>
|
||||
</DIV>
|
||||
<PRE>template <class charT, class Allocator, class traits, class Allocator2>
|
||||
<PRE><A name=f2></A>template <class charT, class Allocator, class traits, class Allocator2>
|
||||
bool regex_search(const charT* str, <a href="match_results.html">match_results</a><const charT*, Allocator>& m,
|
||||
const <a href="basic_regex.html">basic_regex</a><charT, traits, Allocator2>& 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<charT>::length(str), m, e, flags)</CODE>.</P>
|
||||
<PRE>template <class ST, class SA, class Allocator, class charT,
|
||||
<PRE><A name=f3></A>template <class ST, class SA, class Allocator, class charT,
|
||||
class traits, class Allocator2>
|
||||
bool regex_search(const basic_string<charT, ST, SA>& s,
|
||||
<a href="match_results.html">match_results</a><typename basic_string<charT, ST, SA>::const_iterator, Allocator>& m,
|
||||
@ -248,7 +248,7 @@ bool regex_search(const basic_string<charT, ST, SA>& 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 <class iterator, class Allocator, class charT,
|
||||
<PRE><A name=f4></A>template <class iterator, class Allocator, class charT,
|
||||
class traits>
|
||||
bool regex_search(iterator first, iterator last,
|
||||
const <a href="basic_regex.html">basic_regex</a><charT, traits, Allocator>& 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><</CODE>BidirectionalIterator<CODE>> what</CODE>,
|
||||
and then returning the result of <CODE>regex_search(first, last, what, e, flags)</CODE>.</P>
|
||||
<PRE>template <class charT, class Allocator, class traits>
|
||||
<PRE><A name=f5></A>template <class charT, class Allocator, class traits>
|
||||
bool regex_search(const charT* str
|
||||
const <a href="basic_regex.html">basic_regex</a><charT, traits, Allocator>& 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<charT>::length(str), e, flags)</CODE>.</P>
|
||||
<PRE>template <class ST, class SA, class Allocator, class charT,
|
||||
<PRE><A name=f6></A>template <class ST, class SA, class Allocator, class charT,
|
||||
class traits>
|
||||
bool regex_search(const basic_string<charT, ST, SA>& s,
|
||||
const <a href="basic_regex.html">basic_regex</a><charT, traits, Allocator>& e,
|
||||
|
@ -45,35 +45,35 @@ template <class BidirectionalIterator,
|
||||
class regex_token_iterator
|
||||
{
|
||||
public:
|
||||
typedef basic_regex<charT, traits, Allocator> regex_type;
|
||||
typedef <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator> regex_type;
|
||||
typedef basic_string<charT> value_type;
|
||||
typedef typename iterator_traits<BidirectionalIterator>::difference_type difference_type;
|
||||
typedef const value_type* pointer;
|
||||
typedef const value_type& reference;
|
||||
typedef std::forward_iterator_tag iterator_category;
|
||||
|
||||
regex_token_iterator();
|
||||
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,
|
||||
int submatch = 0, match_flag_type m = match_default);
|
||||
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,
|
||||
<A href="#c1">regex_token_iterator</A>();
|
||||
<A href="#c2">regex_token_iterator</A>(BidirectionalIterator a, BidirectionalIterator b, const regex_type& 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& re,
|
||||
const std::vector<int>& submatches, match_flag_type m = match_default);
|
||||
template <std::size_t N>
|
||||
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,
|
||||
<A href="#c4">regex_token_iterator</A>(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,
|
||||
const int (&submatches)[N], match_flag_type m = match_default);
|
||||
regex_token_iterator(const regex_token_iterator&);
|
||||
regex_token_iterator& operator=(const regex_token_iterator&);
|
||||
bool operator==(const regex_token_iterator&);
|
||||
bool operator!=(const regex_token_iterator&);
|
||||
const value_type& operator*();
|
||||
const value_type* operator->();
|
||||
regex_token_iterator& operator++();
|
||||
regex_token_iterator operator++(int);
|
||||
<A href="#c5">regex_token_iterator</A>(const regex_token_iterator&);
|
||||
regex_token_iterator& <A href="#o1">operator</A>=(const regex_token_iterator&);
|
||||
bool <A href="#o2">operator</A>==(const regex_token_iterator&)const;
|
||||
bool <A href="#o3">operator</A>!=(const regex_token_iterator&)const;
|
||||
const value_type& <A href="#o4">operator</A>*()const;
|
||||
const value_type* <A href="#o5">operator</A>->()const;
|
||||
regex_token_iterator& <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& re,
|
||||
<PRE><A name=c2></A>regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& 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& re,
|
||||
<PRE><A name=c3></A>regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,
|
||||
const std::vector<int>& submatches, match_flag_type m = match_default);</PRE>
|
||||
<P><B> Preconditions:</B> <CODE>submatches.size() && !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 <std::size_t N>
|
||||
<PRE><A name=c4></A>template <std::size_t N>
|
||||
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,
|
||||
const int (&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& that);</PRE>
|
||||
<PRE><A name=c5></A>regex_token_iterator(const regex_token_iterator& 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& operator=(const regex_token_iterator& that);</PRE>
|
||||
<PRE><A name=o1></A>regex_token_iterator& operator=(const regex_token_iterator& that);</PRE>
|
||||
<P><B> Effects: </B>sets <CODE>*this</CODE> to be equal to <CODE>that</CODE>.</P>
|
||||
<P><B> Postconditions:</B> <CODE>*this == that</CODE>.</P>
|
||||
<PRE>bool operator==(const regex_token_iterator&);</PRE>
|
||||
<PRE><A name=o2></A>bool operator==(const regex_token_iterator&)const;</PRE>
|
||||
<P>
|
||||
<B>Effects: </B>returns true if *this is the same position as that.</P>
|
||||
<PRE>bool operator!=(const regex_token_iterator&);</PRE>
|
||||
<PRE><A name=o3></A>bool operator!=(const regex_token_iterator&)const;</PRE>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>!(*this == that)</CODE>.</P>
|
||||
<PRE>const value_type& operator*();</PRE>
|
||||
<PRE><A name=o4></A>const value_type& operator*()const;</PRE>
|
||||
<P>
|
||||
<B>Effects: </B>returns the current string being enumerated.</P>
|
||||
<PRE>const value_type* operator->();</PRE>
|
||||
<PRE><A name=o5></A>const value_type* operator->()const;</PRE>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>&(*this)</CODE>.</P>
|
||||
<PRE>regex_token_iterator& operator++();</PRE>
|
||||
<PRE><A name=o6></A>regex_token_iterator& 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& operator++(int);</PRE>
|
||||
Returns:</B><CODE> *this</CODE>.</P><PRE><A name=o7></A>regex_token_iterator& 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>
|
||||
|
@ -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<>
|
||||
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<BidirectionalIterator>::difference_type difference_type;
|
||||
typedef BidirectionalIterator iterator;
|
||||
|
||||
bool matched;
|
||||
bool <A href="#m1">matched</A>;
|
||||
|
||||
difference_type length()const;
|
||||
operator basic_string<value_type>()const;
|
||||
basic_string<value_type> str()const;
|
||||
difference_type <A href="#m2">length</A>()const;
|
||||
operator <A href="#m3">basic_string</A><value_type>()const;
|
||||
basic_string<value_type> <A href="#m4">str</A>()const;
|
||||
|
||||
int compare(const sub_match& s)const;
|
||||
int compare(const basic_string<value_type>& s)const;
|
||||
int compare(const value_type* s)const;
|
||||
int <A href="#m5">compare</A>(const sub_match& s)const;
|
||||
int <A href="#m6">compare</A>(const basic_string<value_type>& s)const;
|
||||
int <A href="#m7">compare</A>(const value_type* s)const;
|
||||
};
|
||||
|
||||
//
|
||||
// comparisons to another sub_match:
|
||||
//
|
||||
template <class BidirectionalIterator>
|
||||
bool operator == (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o11">operator</A> == (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator != (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o12">operator</A> != (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator < (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o13">operator</A> < (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o14">operator</A> <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o15">operator</A> >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator > (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o16">operator</A> > (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
|
||||
|
||||
//
|
||||
// comparisons to a basic_string:
|
||||
//
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator == (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
bool <A href="#o21">operator</A> == (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator != (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
bool <A href="#o22">operator</A> != (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator < (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
bool <A href="#o23">operator</A> < (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator > (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
bool <A href="#o24">operator</A> > (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator >= (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
bool <A href="#o25">operator</A> >= (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator <= (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
bool <A href="#o26">operator</A> <= (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator == (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o31">operator</A> == (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator != (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o32">operator</A> != (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator < (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o33">operator</A> < (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator > (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o34">operator</A> > (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o35">operator</A> >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o36">operator</A> <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);
|
||||
|
||||
//
|
||||
// comparisons to a pointer to a character array:
|
||||
//
|
||||
template <class BidirectionalIterator>
|
||||
bool operator == (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
bool <A href="#o41">operator</A> == (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator != (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
bool <A href="#o42">operator</A> != (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator < (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
bool <A href="#o43">operator</A> < (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator > (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
bool <A href="#o44">operator</A> > (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator >= (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
bool <A href="#o45">operator</A> >= (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator <= (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
bool <A href="#o46">operator</A> <= (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
|
||||
template <class BidirectionalIterator>
|
||||
bool operator == (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o51">operator</A> == (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator != (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o52">operator</A> != (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator < (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o53">operator</A> < (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator > (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o54">operator</A> > (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o55">operator</A> >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o56">operator</A> <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs);
|
||||
|
||||
//
|
||||
// comparisons to a single character:
|
||||
//
|
||||
template <class BidirectionalIterator>
|
||||
bool operator == (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
bool <A href="#o61">operator</A> == (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator != (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
bool <A href="#o62">operator</A> != (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator < (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
bool <A href="#o63">operator</A> < (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator > (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
bool <A href="#o64">operator</A> > (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator >= (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
bool <A href="#o65">operator</A> >= (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator <= (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
bool <A href="#o66">operator</A> <= (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
|
||||
template <class BidirectionalIterator>
|
||||
bool operator == (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o71">operator</A> == (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator != (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o72">operator</A> != (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator < (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o73">operator</A> < (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator > (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o74">operator</A> > (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o75">operator</A> >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o76">operator</A> <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs);
|
||||
//
|
||||
// addition operators:
|
||||
//
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
|
||||
<A href="#o81">operator</A> + (const std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
const sub_match<RandomAccessIterator>& m);
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
|
||||
<A href="#o82">operator</A> + (const sub_match<RandomAccessIterator>& m,
|
||||
const std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s);
|
||||
template <class RandomAccessIterator> std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
||||
<A href="#o83">operator</A> + (typename iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
const sub_match<RandomAccessIterator>& m);
|
||||
template <class RandomAccessIterator> std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
||||
<A href="#o84">operator</A> + (const sub_match<RandomAccessIterator>& m,
|
||||
typename iterator_traits<RandomAccessIterator>::value_type const * s);
|
||||
template <class RandomAccessIterator>
|
||||
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
||||
<A href="#o85">operator</A> + (typename iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
const sub_match<RandomAccessIterator>& m);
|
||||
template <class RandomAccessIterator>
|
||||
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
||||
<A href="#o86">operator</A> + (const sub_match<RandomAccessIterator>& m,
|
||||
typename iterator_traits<RandomAccessIterator>::value_type const& s);
|
||||
template <class RandomAccessIterator>
|
||||
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
||||
<A href="#o87">operator</A> + (const sub_match<RandomAccessIterator>& m1,
|
||||
const sub_match<RandomAccessIterator>& m2);
|
||||
|
||||
//
|
||||
// stream inserter:
|
||||
//
|
||||
template <class charT, class traits, class BidirectionalIterator>
|
||||
basic_ostream<charT, traits>&
|
||||
operator << (basic_ostream<charT, traits>& os,
|
||||
<A href="#oi">operator</A> << (basic_ostream<charT, traits>& os,
|
||||
const sub_match<BidirectionalIterator>& m);
|
||||
|
||||
} // namespace boost</PRE>
|
||||
@ -225,188 +271,278 @@ basic_ostream<charT, traits>&
|
||||
<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<value_type>()const;</PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>(matched ? basic_string<value_type>(first,
|
||||
second) : basic_string<value_type>()).</P></CODE><PRE>basic_string<value_type> str()const;</PRE>
|
||||
|
||||
<P><B>
|
||||
Effects: </B>returns <CODE>(matched ? basic_string<value_type>(first,
|
||||
second) : basic_string<value_type>())</CODE>.</P><PRE>int compare(const sub_match& s)const;</PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>str().compare(s.str())</CODE>.</P><PRE>int compare(const basic_string<value_type>& 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<value_type>()const;</PRE>
|
||||
<P>
|
||||
<B>Effects: </B>converts *this into a string: returns <CODE>(matched ?
|
||||
basic_string<value_type>(first, second) :
|
||||
basic_string<value_type>()).</P>
|
||||
</CODE><PRE><A name=m4></A>basic_string<value_type> str()const;</PRE>
|
||||
<P><B> Effects: </B>returns a string representation of *this: <CODE>(matched ?
|
||||
basic_string<value_type>(first, second) :
|
||||
basic_string<value_type>())</CODE>.</P>
|
||||
<PRE><A name=m5></A>int compare(const sub_match& 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<value_type>& s)const;</PRE>
|
||||
<P><B> Effects: </B>compares *this to the string s: returns <CODE>str().compare(s)</CODE>.</P>
|
||||
<PRE><A name=m7></A>int compare(const value_type* s)const;</PRE>
|
||||
<P>
|
||||
<B>Effects:<B></B> </B>compares *this to the null-terminated string <EM>s</EM>:<B> </B>returns
|
||||
<CODE>str().compare(s)</CODE>.</P>
|
||||
<H4>
|
||||
sub_match non-member operators</H4>
|
||||
<PRE>template <class BidirectionalIterator>
|
||||
<H5>Comparisons against self</H5>
|
||||
<PRE><A name=o11></A>template <class BidirectionalIterator>
|
||||
bool operator == (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.compare(rhs) == 0</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.compare(rhs) == 0</CODE>.</P>
|
||||
<PRE><A name=o12></A>template <class BidirectionalIterator>
|
||||
bool operator != (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.compare(rhs) != 0</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.compare(rhs) != 0</CODE>.</P>
|
||||
<PRE><A name=o13></A>template <class BidirectionalIterator>
|
||||
bool operator < (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.compare(rhs) < 0</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.compare(rhs) < 0</CODE>.</P>
|
||||
<PRE><A name=o14></A>template <class BidirectionalIterator>
|
||||
bool operator <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
|
||||
<P><B>
|
||||
Effects: </B>returns <CODE>lhs.compare(rhs) <= 0</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P><B> Effects: </B>returns <CODE>lhs.compare(rhs) <= 0</CODE>.</P>
|
||||
<PRE><A name=o15></A>template <class BidirectionalIterator>
|
||||
bool operator >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.compare(rhs) >= 0</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.compare(rhs) >= 0</CODE>.</P>
|
||||
<PRE><A name=o16></A>template <class BidirectionalIterator>
|
||||
bool operator > (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.compare(rhs) > 0</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.compare(rhs) > 0</CODE>.</P>
|
||||
<H5>Comparisons with std::basic_string</H5>
|
||||
<pre><A name=o21></A>
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator == (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits,
|
||||
Allocator>& lhs, const sub_match<BidirectionalIterator>& rhs);
|
||||
</pre>
|
||||
<P><B>Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o22></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator != (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o23></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator < (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs < rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o24></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator > (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs > rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o25></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator >= (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs >= rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o26></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator <= (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs <= rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o31></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator == (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P>
|
||||
<PRE><A name=o32></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator != (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P>
|
||||
<PRE><A name=o33></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator < (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs.str() < rhs</CODE>.</P>
|
||||
<PRE><A name=o34></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator > (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs.str() > rhs</CODE>.</P>
|
||||
<PRE><A name=o35></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs.str() >= rhs</CODE>.</P>
|
||||
<PRE><A name=o36></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs.str() <= rhs</CODE>.</P>
|
||||
<H5>Comparisons with null-terminated strings</H5>
|
||||
<PRE><A name=o41></A>template <class BidirectionalIterator>
|
||||
bool operator == (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o42></A>template <class BidirectionalIterator>
|
||||
bool operator != (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P>
|
||||
<PRE></A><A name=o43></A>template <class BidirectionalIterator>
|
||||
bool operator < (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs < rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs < rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o44></A>template <class BidirectionalIterator>
|
||||
bool operator > (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs > rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs > rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o45></A>template <class BidirectionalIterator>
|
||||
bool operator >= (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs >= rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs >= rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o46></A>template <class BidirectionalIterator>
|
||||
bool operator <= (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs <= rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs <= rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o51></A>template <class BidirectionalIterator>
|
||||
bool operator == (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P>
|
||||
<PRE><A name=o52></A>template <class BidirectionalIterator>
|
||||
bool operator != (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P>
|
||||
<PRE><A name=o53></A>template <class BidirectionalIterator>
|
||||
bool operator < (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() < rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() < rhs</CODE>.</P>
|
||||
<PRE><A name=o54></A>template <class BidirectionalIterator>
|
||||
bool operator > (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() > rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() > rhs</CODE>.</P>
|
||||
<PRE><A name=o55></A>template <class BidirectionalIterator>
|
||||
bool operator >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() >= rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() >= rhs</CODE>.</P>
|
||||
<PRE><A name=o56></A>template <class BidirectionalIterator>
|
||||
bool operator <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() <= rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() <= rhs</CODE>.</P>
|
||||
<H5>Comparisons with a single character</H5>
|
||||
<PRE><A name=o61></A>template <class BidirectionalIterator>
|
||||
bool operator == (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o62></A>template <class BidirectionalIterator>
|
||||
bool operator != (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o63></A>template <class BidirectionalIterator>
|
||||
bool operator < (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs < rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs < rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o64></A>template <class BidirectionalIterator>
|
||||
bool operator > (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs > rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs > rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o65></A>template <class BidirectionalIterator>
|
||||
bool operator >= (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs >= rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs >= rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o66></A>template <class BidirectionalIterator>
|
||||
bool operator <= (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs <= rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs <= rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o71></A>template <class BidirectionalIterator>
|
||||
bool operator == (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P>
|
||||
<PRE><A name=o72></A>template <class BidirectionalIterator>
|
||||
bool operator != (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P>
|
||||
<PRE><A name=o73></A>template <class BidirectionalIterator>
|
||||
bool operator < (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() < rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() < rhs</CODE>.</P>
|
||||
<PRE><A name=o74></A>template <class BidirectionalIterator>
|
||||
bool operator > (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() > rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() > rhs</CODE>.</P>
|
||||
<PRE><A name=o75></A>template <class BidirectionalIterator>
|
||||
bool operator >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() >= rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() >= rhs</CODE>.</P>
|
||||
<PRE><A name=o76></A>template <class BidirectionalIterator>
|
||||
bool operator <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() <= rhs</CODE>.</P><PRE>template <class charT, class traits, class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() <= 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 <class RandomAccessIterator, class traits, class Allocator>
|
||||
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
|
||||
operator + (const std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
const sub_match<RandomAccessIterator>& m); </PRE>
|
||||
<P><B>Effects: </B>returns <CODE>s + m.str()</CODE>.</P>
|
||||
<PRE><A name=o82></A>template <class RandomAccessIterator, class traits, class Allocator>
|
||||
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
|
||||
operator + (const sub_match<RandomAccessIterator>& m,
|
||||
const std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s); </PRE>
|
||||
<P><B>Effects: </B>returns <CODE>m.str() + s</CODE>.</P>
|
||||
<PRE><A name=o83></A>template <class RandomAccessIterator> std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (typename iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
const sub_match<RandomAccessIterator>& m); </PRE>
|
||||
<P><B>Effects: </B>returns <CODE>s + m.str()</CODE>.</P>
|
||||
<PRE><A name=o84></A>template <class RandomAccessIterator> std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (const sub_match<RandomAccessIterator>& m,
|
||||
typename iterator_traits<RandomAccessIterator>::value_type const * s);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>m.str() + s</CODE>.</P>
|
||||
<PRE><A name=o85></A>template <class RandomAccessIterator>
|
||||
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (typename iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
const sub_match<RandomAccessIterator>& m); </PRE>
|
||||
<P><B>Effects: </B>returns <CODE>s + m.str()</CODE>.</P>
|
||||
<PRE><A name=o86></A>template <class RandomAccessIterator>
|
||||
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (const sub_match<RandomAccessIterator>& m,
|
||||
typename iterator_traits<RandomAccessIterator>::value_type const& s); </PRE>
|
||||
<P><B>Effects: </B>returns <CODE>m.str() + s</CODE>.</P>
|
||||
<PRE><A name=o87></A>template <class RandomAccessIterator>
|
||||
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (const sub_match<RandomAccessIterator>& m1,
|
||||
const sub_match<RandomAccessIterator>& m2);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>m1.str() + m2.str()</CODE>.</P>
|
||||
<h5>Stream inserter</h5>
|
||||
<PRE><A name=oi></A>template <class charT, class traits, class BidirectionalIterator>
|
||||
basic_ostream<charT, traits>&
|
||||
operator << (basic_ostream<charT, traits>& os
|
||||
const sub_match<BidirectionalIterator>& m);</PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>(os << m.str())</CODE>.
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>(os << m.str())</CODE>.
|
||||
<HR>
|
||||
<p>Revised
|
||||
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
|
||||
@ -422,5 +558,3 @@ basic_ostream<charT, traits>&
|
||||
for any purpose. It is provided "as is" without express or implied warranty.</I></P>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
@ -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><> 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>
|
||||
|
||||
|
1785
doc/basic_regex.html
1785
doc/basic_regex.html
File diff suppressed because it is too large
Load Diff
@ -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">
|
||||
<regex.h></a> and <a href="http://www.opengroup.org/onlinepubs/7908799/xsh/nl_types.h.html">
|
||||
<nl_types.h></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> 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>; 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 tutorials on regular expressions can be <A href="http://etext.lib.virginia.edu/helpsheets/regex.html">
|
||||
found here</A> and <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">
|
||||
<regex.h></a> and <a href="http://www.opengroup.org/onlinepubs/7908799/xsh/nl_types.h.html">
|
||||
<nl_types.h></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> 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>
|
||||
|
@ -27,17 +27,20 @@
|
||||
<P>Boost 1.31.0.</P>
|
||||
<UL>
|
||||
<LI>
|
||||
Completely rewritten pattern matching code - it is now up to 10 times faster
|
||||
than before.</LI>
|
||||
Completely rewritten pattern matching code - it is now up to 10 times faster
|
||||
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>
|
||||
|
||||
|
@ -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<std::string::const_iterator> smatch;
|
||||
<STRONG>typedef</STRONG> match_results<std::wstring::const_iterator> 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 <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> 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> 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>
|
||||
|
||||
|
||||
|
||||
|
@ -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. 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" 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>© Copyright <a href="mailto:jm@regex.fsnet.co.uk">John
|
||||
Maddock</a> 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" 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> 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>
|
||||
|
||||
|
||||
|
@ -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 <<a href="../../../boost/regex.hpp">boost/regex.hpp</a>></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> . 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 <<a href="../../../boost/regex.hpp">boost/regex.hpp</a>></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> . 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 <class BidirectionalIterator,
|
||||
class Allocator = allocator<sub_match<BidirectionalIterator> >
|
||||
class match_results;
|
||||
@ -98,414 +78,354 @@ public:
|
||||
typedef basic_string<char_type> string_type;
|
||||
|
||||
// construct/copy/destroy:
|
||||
explicit match_results(const Allocator& a = Allocator());
|
||||
match_results(const match_results& m);
|
||||
match_results& operator=(const match_results& m);
|
||||
explicit <A href="#c1">match_results</A>(const Allocator& a = Allocator());
|
||||
<A href="#c2">match_results</A>(const match_results& m);
|
||||
<A href="#c3">match_results</A>& <A href="#c3">operator</A>=(const match_results& 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 <class OutputIterator>
|
||||
OutputIterator format(OutputIterator out,
|
||||
OutputIterator <A href="#m12">format</A>(OutputIterator out,
|
||||
const string_type& fmt,
|
||||
match_flag_type flags = format_default) const;
|
||||
string_type format(const string_type& fmt,
|
||||
string_type <A href="#m13">format</A>(const string_type& fmt,
|
||||
match_flag_type flags = format_default) const;
|
||||
|
||||
allocator_type get_allocator() const;
|
||||
void swap(match_results& that);
|
||||
allocator_type <A href="#m14">get_allocator</A>() const;
|
||||
void <A href="#m15">swap</A>(match_results& that);
|
||||
};
|
||||
|
||||
template <class BidirectionalIterator, class Allocator>
|
||||
bool operator == (const match_results<BidirectionalIterator, Allocator>& m1,
|
||||
bool <A href="#n1">operator</A> == (const match_results<BidirectionalIterator, Allocator>& m1,
|
||||
const match_results<BidirectionalIterator, Allocator>& m2);
|
||||
template <class BidirectionalIterator, class Allocator>
|
||||
bool operator != (const match_results<BidirectionalIterator, Allocator>& m1,
|
||||
bool <A href="#n2">operator</A> != (const match_results<BidirectionalIterator, Allocator>& m1,
|
||||
const match_results<BidirectionalIterator, Allocator>& m2);
|
||||
|
||||
template <class charT, class traits, class BidirectionalIterator, class Allocator>
|
||||
basic_ostream<charT, traits>&
|
||||
operator << (basic_ostream<charT, traits>& os,
|
||||
<A href="#n3">operator</A> << (basic_ostream<charT, traits>& os,
|
||||
const match_results<BidirectionalIterator, Allocator>& m);
|
||||
|
||||
template <class BidirectionalIterator, class Allocator>
|
||||
void swap(match_results<BidirectionalIterator, Allocator>& m1,
|
||||
void <A href="#n4">swap</A>(match_results<BidirectionalIterator, Allocator>& m1,
|
||||
match_results<BidirectionalIterator, Allocator>& 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& 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<charT>()</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</center>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<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<charT>()</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</center>
|
||||
<p> </p>
|
||||
<pre><A name=c2></A>
|
||||
match_results(const match_results& m);
|
||||
</pre>
|
||||
|
||||
<b></b>
|
||||
<p><b>Effects:</b> Constructs an object of class match_results, as
|
||||
a copy of m.</p>
|
||||
|
||||
<pre>
|
||||
<b></b>
|
||||
<p><b>Effects:</b> Constructs an object of class match_results, as a copy of m.</p>
|
||||
<pre><A name=c3></A>
|
||||
match_results& operator=(const match_results& 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 < 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 < 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 < 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 < m.size().</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</center>
|
||||
|
||||
<h4>match_results size</h4>
|
||||
|
||||
<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 < 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 < 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 < 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 < 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>
|
||||
<b></b>
|
||||
<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>
|
||||
<b></b>
|
||||
<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>
|
||||
<b></b>
|
||||
<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>
|
||||
<b></b>
|
||||
<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>
|
||||
<b></b>
|
||||
<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>
|
||||
<b></b>
|
||||
<p><b>Effects:</b> Returns sub-expression <EM>sub</EM> as a string: <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>
|
||||
<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. 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>
|
||||
<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><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>
|
||||
<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><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>
|
||||
<b></b>
|
||||
<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>
|
||||
<b></b>
|
||||
<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 <class OutputIterator>
|
||||
OutputIterator format(OutputIterator out,
|
||||
const string_type& 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>
|
||||
|
||||
<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>
|
||||
|
||||
<b></b>
|
||||
<p><b>Returns:</b> <i>out</i>.</p>
|
||||
|
||||
<pre>
|
||||
<b></b>
|
||||
<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>
|
||||
<b></b>
|
||||
<p><b>Returns:</b> <i>out</i>.</p>
|
||||
<pre><A name=m13></A>
|
||||
string_type format(const string_type& 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>
|
||||
<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><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>
|
||||
<b></b>
|
||||
<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& that);
|
||||
</pre>
|
||||
|
||||
<b></b>
|
||||
<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>
|
||||
|
||||
<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>© Copyright <a href="mailto:jm@regex.fsnet.co.uk">John
|
||||
Maddock</a> 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>
|
||||
<b></b>
|
||||
<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>
|
||||
<b></b>
|
||||
<p><b>Complexity:</b> constant time.</p>
|
||||
<h4>match_results non-members</h4>
|
||||
<PRE><A name=n1></A>template <class BidirectionalIterator, class Allocator>
|
||||
bool operator == (const match_results<BidirectionalIterator, Allocator>& m1,
|
||||
const match_results<BidirectionalIterator, Allocator>& m2);</PRE>
|
||||
<P><B>Effects:</B> Compares the two sequences for equality.</P>
|
||||
<PRE><A name=n2></A>template <class BidirectionalIterator, class Allocator>
|
||||
bool operator != (const match_results<BidirectionalIterator, Allocator>& m1,
|
||||
const match_results<BidirectionalIterator, Allocator>& m2);</PRE>
|
||||
<P><B>Effects:</B> Compares the two sequences for inequality.</P>
|
||||
<PRE><A name=n3></A>template <class charT, class traits, class BidirectionalIterator, class Allocator>
|
||||
basic_ostream<charT, traits>&
|
||||
operator << (basic_ostream<charT, traits>& os,
|
||||
const match_results<BidirectionalIterator, Allocator>& 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 << m.str();</code> Returns <EM>os</EM>..</P>
|
||||
<PRE><A name=n4></A>template <class BidirectionalIterator, class Allocator>
|
||||
void swap(match_results<BidirectionalIterator, Allocator>& m1,
|
||||
match_results<BidirectionalIterator, Allocator>& 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> 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>
|
||||
|
||||
|
||||
|
@ -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>
|
||||
|
@ -42,40 +42,39 @@ template <class BidirectionalIterator,
|
||||
class regex_iterator
|
||||
{
|
||||
public:
|
||||
typedef basic_regex<charT, traits, Allocator> regex_type;
|
||||
typedef match_results<BidirectionalIterator> value_type;
|
||||
typedef <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator> regex_type;
|
||||
typedef <A href="match_results.html">match_results</A><BidirectionalIterator> value_type;
|
||||
typedef typename iterator_traits<BidirectionalIterator>::difference_type difference_type;
|
||||
typedef const value_type* pointer;
|
||||
typedef const value_type& 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& re,
|
||||
match_flag_type m = match_default);
|
||||
regex_iterator(const regex_iterator&);
|
||||
regex_iterator& operator=(const regex_iterator&);
|
||||
bool operator==(const regex_iterator&);
|
||||
bool operator!=(const regex_iterator&);
|
||||
const value_type& operator*();
|
||||
const value_type* operator->();
|
||||
regex_iterator& 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&);
|
||||
regex_iterator& <A href="#o1">operator</A>=(const regex_iterator&);
|
||||
bool <A href="#o2">operator</A>==(const regex_iterator&)const;
|
||||
bool <A href="#o3">operator</A>!=(const regex_iterator&)const;
|
||||
const value_type& <A href="#o4">operator</A>*()const;
|
||||
const value_type* <A href="#o5">operator</A>->()const;
|
||||
regex_iterator& <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& 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& 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& operator=(const regex_iterator&);
|
||||
</pre>
|
||||
<b></b>
|
||||
<p><b>Effects:</b> sets <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& that);
|
||||
<pre><A name=o2></A>
|
||||
bool operator==(const regex_iterator& that)const;
|
||||
</pre>
|
||||
<b></b>
|
||||
<p><b>Effects:</b> returns true if *this is equal to that.</p>
|
||||
<pre>
|
||||
bool operator!=(const regex_iterator&);
|
||||
<pre><A name=o3></A>
|
||||
bool operator!=(const regex_iterator&)const;
|
||||
</pre>
|
||||
<b></b>
|
||||
<p><b>Effects:</b> returns <code>!(*this == that)</code>.</p>
|
||||
<pre>
|
||||
const value_type& operator*();
|
||||
<pre><A name=o4></A>
|
||||
const value_type& 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& 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& 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& 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& 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& operator*();
|
||||
</table>
|
||||
<br>
|
||||
<br>
|
||||
<pre>
|
||||
const value_type* operator->();
|
||||
<pre><A name=o5></A>
|
||||
const value_type* operator->()const;
|
||||
</pre>
|
||||
<b></b>
|
||||
<p><b>Effects:</b> returns <code>&(*this)</code>.</p>
|
||||
<pre>
|
||||
<pre><A name=o6></A>
|
||||
regex_iterator& operator++();
|
||||
</pre>
|
||||
<p><strong>Effects:</strong> moves the iterator to the next match in the
|
||||
@ -282,7 +285,7 @@ regex_iterator& 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>
|
||||
|
@ -31,47 +31,53 @@
|
||||
</dl>
|
||||
<H3><A name="synopsis"></A>Synopsis</H3>
|
||||
<PRE><A name=query_match></A>#include <<A href="../../../boost/regex.hpp">boost/regex.hpp</A>> </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
|
||||
this function is data input validation.
|
||||
<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. </STRONG> If you want to search for an expression
|
||||
somewhere within the sequence then use <A href="regex_search.html">regex_search</A>.
|
||||
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 <class BidirectionalIterator, class Allocator, class charT,
|
||||
class traits, class Allocator2>
|
||||
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><BidirectionalIterator, Allocator>& m,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator2>& e,
|
||||
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);
|
||||
|
||||
template <class BidirectionalIterator, class charT, class traits, class Allocator2>
|
||||
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><charT, traits, Allocator2>& e,
|
||||
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);
|
||||
|
||||
template <class charT, class Allocator, class traits, class Allocator2>
|
||||
bool regex_match(const charT* str, <A href="match_results.html">match_results</A><const charT*, Allocator>& m,
|
||||
bool <A href="#f3">regex_match</A>(const charT* str, <A href="match_results.html">match_results</A><const charT*, Allocator>& m,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator2>& e,
|
||||
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);
|
||||
|
||||
template <class ST, class SA, class Allocator, class charT,
|
||||
class traits, class Allocator2>
|
||||
bool regex_match(const basic_string<charT, ST, SA>& s,
|
||||
bool <A href="#f4">regex_match</A>(const basic_string<charT, ST, SA>& s,
|
||||
<A href="match_results.html">match_results</A><typename basic_string<charT, ST, SA>::const_iterator, Allocator>& m,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator2>& e,
|
||||
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);
|
||||
|
||||
template <class charT, class traits, class Allocator2>
|
||||
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><charT, traits, Allocator2>& e,
|
||||
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);
|
||||
|
||||
template <class ST, class SA, class charT, class traits, class Allocator2>
|
||||
bool regex_match(const basic_string<charT, ST, SA>& s,
|
||||
bool <A href="#f6">regex_match</A>(const basic_string<charT, ST, SA>& s,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator2>& e,
|
||||
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);
|
||||
</PRE>
|
||||
<H3><A name="description"></A>Description</H3>
|
||||
<PRE>template <class BidirectionalIterator, class Allocator, class charT,
|
||||
<PRE><A name=f1></A>template <class BidirectionalIterator, class Allocator, class charT,
|
||||
class traits, class Allocator2>
|
||||
bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
|
||||
<A href="match_results.html">match_results</A><BidirectionalIterator, Allocator>& 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> </PRE>
|
||||
<PRE>template <class BidirectionalIterator, class charT, class traits, class Allocator2>
|
||||
<PRE><A name=f2></A>template <class BidirectionalIterator, class charT, class traits, class Allocator2>
|
||||
bool regex_match(BidirectionalIterator first, BidirectionalIterator last,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator2>& 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><</CODE>BidirectionalIterator<CODE>> what</CODE>,
|
||||
and then returning the result of <CODE>regex_match(first, last, what, e, flags)</CODE>.</P>
|
||||
<PRE>template <class charT, class Allocator, class traits, class Allocator2>
|
||||
<PRE><A name=f3></A>template <class charT, class Allocator, class traits, class Allocator2>
|
||||
bool regex_match(const charT* str, <A href="match_results.html">match_results</A><const charT*, Allocator>& m,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator2>& 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<charT>::length(str), m, e, flags)</CODE>.</P>
|
||||
<PRE>template <class ST, class SA, class Allocator, class charT,
|
||||
<PRE><A name=f4></A>template <class ST, class SA, class Allocator, class charT,
|
||||
class traits, class Allocator2>
|
||||
bool regex_match(const basic_string<charT, ST, SA>& s,
|
||||
<A href="match_results.html">match_results</A><typename basic_string<charT, ST, SA>::const_iterator, Allocator>& m,
|
||||
@ -252,13 +258,13 @@ bool regex_match(const basic_string<charT, ST, SA>& 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 <class charT, class traits, class Allocator2>
|
||||
<PRE><A name=f5></A>template <class charT, class traits, class Allocator2>
|
||||
bool regex_match(const charT* str,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator2>& 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<charT>::length(str), e, flags)</CODE>.</P>
|
||||
<PRE>template <class ST, class SA, class charT, class traits, class Allocator2>
|
||||
<PRE><A name=f6></A>template <class ST, class SA, class charT, class traits, class Allocator2>
|
||||
bool regex_match(const basic_string<charT, ST, SA>& s,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator2>& e,
|
||||
<A href="match_flag_type.html">match_flag_type</A> flags = match_default);</PRE>
|
||||
|
@ -29,7 +29,7 @@
|
||||
<H3><A name="synopsis"></A>Synopsis</H3>
|
||||
<PRE>#include <<A href="../../../boost/regex.hpp">boost/regex.hpp</A>> </PRE>
|
||||
<P>The algorithm regex_replace searches through 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. <PRE>template <class OutputIterator, class BidirectionalIterator, class traits,
|
||||
class Allocator, class charT>
|
||||
OutputIterator regex_replace(OutputIterator out,
|
||||
OutputIterator <A href="#f1">regex_replace</A>(OutputIterator out,
|
||||
BidirectionalIterator first,
|
||||
BidirectionalIterator last,
|
||||
const basic_regex<charT, traits, Allocator>& e,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator>& e,
|
||||
const basic_string<charT>& fmt,
|
||||
match_flag_type flags = match_default);
|
||||
<A href="match_flag_type.html">match_flag_type flags = match_default</A>);
|
||||
|
||||
template <class traits, class Allocator, class charT>
|
||||
basic_string<charT> regex_replace(const basic_string<charT>& s,
|
||||
const basic_regex<charT, traits, Allocator>& e,
|
||||
basic_string<charT> <A href="#f2">regex_replace</A>(const basic_string<charT>& s,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator>& e,
|
||||
const basic_string<charT>& 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 <class OutputIterator, class BidirectionalIterator, class traits,
|
||||
<PRE><A name=f1></A>template <class OutputIterator, class BidirectionalIterator, class traits,
|
||||
class Allocator, class charT>
|
||||
OutputIterator regex_replace(OutputIterator out,
|
||||
BidirectionalIterator first,
|
||||
BidirectionalIterator last,
|
||||
const basic_regex<charT, traits, Allocator>& e,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator>& e,
|
||||
const basic_string<charT>& 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<BidirectionalIterator>
|
||||
</CODE>that occur within the sequence [first, last). If no such matches are
|
||||
found and <CODE>!(flags & format_no_copy)</CODE> then calls <CODE>std::copy(first,
|
||||
last, out)</CODE>. Otherwise, for each match found, if <CODE>!(flags &
|
||||
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 & 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 & 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>. </P>
|
||||
<P>If the flag format_no_copy is set in <EM>flags</EM> then unmatched sections of
|
||||
text are not copied to output.
|
||||
</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.
|
||||
</P>
|
||||
<P>The manner in which the format string <EM>fmt</EM> is interpretted, along with
|
||||
the rules used for finding matches, 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<</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> <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'"><<SPAN class="spelle">BidirectionalIterator</SPAN>> </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 & <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 & <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 & <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 &
|
||||
<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 <class traits, class Allocator, class charT>
|
||||
<PRE><A name=f2></A>template <class traits, class Allocator, class charT>
|
||||
basic_string<charT> regex_replace(const basic_string<charT>& s,
|
||||
const basic_regex<charT, traits, Allocator>& e,
|
||||
const <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator>& e,
|
||||
const basic_string<charT>& 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<charT> result</CODE>,
|
||||
calls <CODE>regex_replace(back_inserter(result), s.begin(), s.end(), e, fmt,
|
||||
flags)</CODE>, and then returns <CODE>result</CODE>.
|
||||
|
@ -37,7 +37,7 @@
|
||||
<PRE>template <class BidirectionalIterator,
|
||||
class Allocator, class charT,
|
||||
class traits, class Allocator2>
|
||||
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><BidirectionalIterator, Allocator>& m,
|
||||
const <a href="basic_regex.html">basic_regex</a><charT, traits, Allocator2>& 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 <class ST, class SA,
|
||||
class Allocator, class charT,
|
||||
class traits, class Allocator2>
|
||||
bool regex_search(const basic_string<charT, ST, SA>& s,
|
||||
bool <A href="#f2">regex_search</A>(const basic_string<charT, ST, SA>& s,
|
||||
<a href="match_results.html">match_results</a><
|
||||
typename basic_string<charT, ST,SA>::const_iterator,
|
||||
Allocator>& m,
|
||||
@ -54,32 +54,32 @@ bool regex_search(const basic_string<charT, ST, SA>& s,
|
||||
|
||||
template<class charT, class Allocator, class traits,
|
||||
class Allocator2>
|
||||
bool regex_search(const charT* str,
|
||||
bool <A href="#f3">regex_search</A>(const charT* str,
|
||||
<a href="match_results.html">match_results</a><const charT*, Allocator>& m,
|
||||
const <a href="basic_regex.html">basic_regex</a><charT, traits, Allocator2>& e,
|
||||
<a href="match_flag_type.html">match_flag_type</a> flags = match_default);
|
||||
|
||||
template <class BidirectionalIterator, class Allocator,
|
||||
class charT, class traits>
|
||||
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><charT, traits, Allocator>& e,
|
||||
<a href="match_flag_type.html">match_flag_type</a> flags = match_default);
|
||||
|
||||
template <class charT, class Allocator,
|
||||
class traits>
|
||||
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><charT, traits, Allocator>& e,
|
||||
<a href="match_flag_type.html">match_flag_type</a> flags = match_default);
|
||||
|
||||
template<class ST, class SA,
|
||||
class Allocator, class charT,
|
||||
class traits>
|
||||
bool regex_search(const basic_string<charT, ST, SA>& s,
|
||||
bool <A href="#f6">regex_search</A>(const basic_string<charT, ST, SA>& s,
|
||||
const <a href="basic_regex.html">basic_regex</a><charT, traits, Allocator>& e,
|
||||
<a href="match_flag_type.html">match_flag_type</a> flags = match_default);
|
||||
</PRE>
|
||||
<H3><A name="description"></A>Description</H3>
|
||||
<PRE>template <class BidirectionalIterator, class Allocator, class charT,
|
||||
<PRE><A name=f1></A>template <class BidirectionalIterator, class Allocator, class charT,
|
||||
class traits, class Allocator2>
|
||||
bool regex_search(BidirectionalIterator first, BidirectionalIterator last,
|
||||
<a href="match_results.html">match_results</a><BidirectionalIterator, Allocator>& m,
|
||||
@ -234,13 +234,13 @@ bool regex_search(BidirectionalIterator first, BidirectionalIterator last,
|
||||
</TD></TR></TABLE>
|
||||
</CENTER>
|
||||
</DIV>
|
||||
<PRE>template <class charT, class Allocator, class traits, class Allocator2>
|
||||
<PRE><A name=f2></A>template <class charT, class Allocator, class traits, class Allocator2>
|
||||
bool regex_search(const charT* str, <a href="match_results.html">match_results</a><const charT*, Allocator>& m,
|
||||
const <a href="basic_regex.html">basic_regex</a><charT, traits, Allocator2>& 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<charT>::length(str), m, e, flags)</CODE>.</P>
|
||||
<PRE>template <class ST, class SA, class Allocator, class charT,
|
||||
<PRE><A name=f3></A>template <class ST, class SA, class Allocator, class charT,
|
||||
class traits, class Allocator2>
|
||||
bool regex_search(const basic_string<charT, ST, SA>& s,
|
||||
<a href="match_results.html">match_results</a><typename basic_string<charT, ST, SA>::const_iterator, Allocator>& m,
|
||||
@ -248,7 +248,7 @@ bool regex_search(const basic_string<charT, ST, SA>& 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 <class iterator, class Allocator, class charT,
|
||||
<PRE><A name=f4></A>template <class iterator, class Allocator, class charT,
|
||||
class traits>
|
||||
bool regex_search(iterator first, iterator last,
|
||||
const <a href="basic_regex.html">basic_regex</a><charT, traits, Allocator>& 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><</CODE>BidirectionalIterator<CODE>> what</CODE>,
|
||||
and then returning the result of <CODE>regex_search(first, last, what, e, flags)</CODE>.</P>
|
||||
<PRE>template <class charT, class Allocator, class traits>
|
||||
<PRE><A name=f5></A>template <class charT, class Allocator, class traits>
|
||||
bool regex_search(const charT* str
|
||||
const <a href="basic_regex.html">basic_regex</a><charT, traits, Allocator>& 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<charT>::length(str), e, flags)</CODE>.</P>
|
||||
<PRE>template <class ST, class SA, class Allocator, class charT,
|
||||
<PRE><A name=f6></A>template <class ST, class SA, class Allocator, class charT,
|
||||
class traits>
|
||||
bool regex_search(const basic_string<charT, ST, SA>& s,
|
||||
const <a href="basic_regex.html">basic_regex</a><charT, traits, Allocator>& e,
|
||||
|
@ -45,35 +45,35 @@ template <class BidirectionalIterator,
|
||||
class regex_token_iterator
|
||||
{
|
||||
public:
|
||||
typedef basic_regex<charT, traits, Allocator> regex_type;
|
||||
typedef <A href="basic_regex.html">basic_regex</A><charT, traits, Allocator> regex_type;
|
||||
typedef basic_string<charT> value_type;
|
||||
typedef typename iterator_traits<BidirectionalIterator>::difference_type difference_type;
|
||||
typedef const value_type* pointer;
|
||||
typedef const value_type& reference;
|
||||
typedef std::forward_iterator_tag iterator_category;
|
||||
|
||||
regex_token_iterator();
|
||||
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,
|
||||
int submatch = 0, match_flag_type m = match_default);
|
||||
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,
|
||||
<A href="#c1">regex_token_iterator</A>();
|
||||
<A href="#c2">regex_token_iterator</A>(BidirectionalIterator a, BidirectionalIterator b, const regex_type& 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& re,
|
||||
const std::vector<int>& submatches, match_flag_type m = match_default);
|
||||
template <std::size_t N>
|
||||
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,
|
||||
<A href="#c4">regex_token_iterator</A>(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,
|
||||
const int (&submatches)[N], match_flag_type m = match_default);
|
||||
regex_token_iterator(const regex_token_iterator&);
|
||||
regex_token_iterator& operator=(const regex_token_iterator&);
|
||||
bool operator==(const regex_token_iterator&);
|
||||
bool operator!=(const regex_token_iterator&);
|
||||
const value_type& operator*();
|
||||
const value_type* operator->();
|
||||
regex_token_iterator& operator++();
|
||||
regex_token_iterator operator++(int);
|
||||
<A href="#c5">regex_token_iterator</A>(const regex_token_iterator&);
|
||||
regex_token_iterator& <A href="#o1">operator</A>=(const regex_token_iterator&);
|
||||
bool <A href="#o2">operator</A>==(const regex_token_iterator&)const;
|
||||
bool <A href="#o3">operator</A>!=(const regex_token_iterator&)const;
|
||||
const value_type& <A href="#o4">operator</A>*()const;
|
||||
const value_type* <A href="#o5">operator</A>->()const;
|
||||
regex_token_iterator& <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& re,
|
||||
<PRE><A name=c2></A>regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& 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& re,
|
||||
<PRE><A name=c3></A>regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,
|
||||
const std::vector<int>& submatches, match_flag_type m = match_default);</PRE>
|
||||
<P><B> Preconditions:</B> <CODE>submatches.size() && !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 <std::size_t N>
|
||||
<PRE><A name=c4></A>template <std::size_t N>
|
||||
regex_token_iterator(BidirectionalIterator a, BidirectionalIterator b, const regex_type& re,
|
||||
const int (&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& that);</PRE>
|
||||
<PRE><A name=c5></A>regex_token_iterator(const regex_token_iterator& 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& operator=(const regex_token_iterator& that);</PRE>
|
||||
<PRE><A name=o1></A>regex_token_iterator& operator=(const regex_token_iterator& that);</PRE>
|
||||
<P><B> Effects: </B>sets <CODE>*this</CODE> to be equal to <CODE>that</CODE>.</P>
|
||||
<P><B> Postconditions:</B> <CODE>*this == that</CODE>.</P>
|
||||
<PRE>bool operator==(const regex_token_iterator&);</PRE>
|
||||
<PRE><A name=o2></A>bool operator==(const regex_token_iterator&)const;</PRE>
|
||||
<P>
|
||||
<B>Effects: </B>returns true if *this is the same position as that.</P>
|
||||
<PRE>bool operator!=(const regex_token_iterator&);</PRE>
|
||||
<PRE><A name=o3></A>bool operator!=(const regex_token_iterator&)const;</PRE>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>!(*this == that)</CODE>.</P>
|
||||
<PRE>const value_type& operator*();</PRE>
|
||||
<PRE><A name=o4></A>const value_type& operator*()const;</PRE>
|
||||
<P>
|
||||
<B>Effects: </B>returns the current string being enumerated.</P>
|
||||
<PRE>const value_type* operator->();</PRE>
|
||||
<PRE><A name=o5></A>const value_type* operator->()const;</PRE>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>&(*this)</CODE>.</P>
|
||||
<PRE>regex_token_iterator& operator++();</PRE>
|
||||
<PRE><A name=o6></A>regex_token_iterator& 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& operator++(int);</PRE>
|
||||
Returns:</B><CODE> *this</CODE>.</P><PRE><A name=o7></A>regex_token_iterator& 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>
|
||||
|
@ -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<>
|
||||
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<BidirectionalIterator>::difference_type difference_type;
|
||||
typedef BidirectionalIterator iterator;
|
||||
|
||||
bool matched;
|
||||
bool <A href="#m1">matched</A>;
|
||||
|
||||
difference_type length()const;
|
||||
operator basic_string<value_type>()const;
|
||||
basic_string<value_type> str()const;
|
||||
difference_type <A href="#m2">length</A>()const;
|
||||
operator <A href="#m3">basic_string</A><value_type>()const;
|
||||
basic_string<value_type> <A href="#m4">str</A>()const;
|
||||
|
||||
int compare(const sub_match& s)const;
|
||||
int compare(const basic_string<value_type>& s)const;
|
||||
int compare(const value_type* s)const;
|
||||
int <A href="#m5">compare</A>(const sub_match& s)const;
|
||||
int <A href="#m6">compare</A>(const basic_string<value_type>& s)const;
|
||||
int <A href="#m7">compare</A>(const value_type* s)const;
|
||||
};
|
||||
|
||||
//
|
||||
// comparisons to another sub_match:
|
||||
//
|
||||
template <class BidirectionalIterator>
|
||||
bool operator == (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o11">operator</A> == (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator != (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o12">operator</A> != (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator < (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o13">operator</A> < (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o14">operator</A> <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o15">operator</A> >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator > (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o16">operator</A> > (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
|
||||
|
||||
//
|
||||
// comparisons to a basic_string:
|
||||
//
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator == (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
bool <A href="#o21">operator</A> == (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator != (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
bool <A href="#o22">operator</A> != (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator < (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
bool <A href="#o23">operator</A> < (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator > (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
bool <A href="#o24">operator</A> > (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator >= (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
bool <A href="#o25">operator</A> >= (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator <= (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
bool <A href="#o26">operator</A> <= (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator == (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o31">operator</A> == (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator != (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o32">operator</A> != (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator < (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o33">operator</A> < (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator > (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o34">operator</A> > (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o35">operator</A> >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o36">operator</A> <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);
|
||||
|
||||
//
|
||||
// comparisons to a pointer to a character array:
|
||||
//
|
||||
template <class BidirectionalIterator>
|
||||
bool operator == (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
bool <A href="#o41">operator</A> == (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator != (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
bool <A href="#o42">operator</A> != (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator < (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
bool <A href="#o43">operator</A> < (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator > (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
bool <A href="#o44">operator</A> > (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator >= (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
bool <A href="#o45">operator</A> >= (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator <= (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
bool <A href="#o46">operator</A> <= (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
|
||||
template <class BidirectionalIterator>
|
||||
bool operator == (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o51">operator</A> == (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator != (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o52">operator</A> != (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator < (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o53">operator</A> < (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator > (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o54">operator</A> > (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o55">operator</A> >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o56">operator</A> <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs);
|
||||
|
||||
//
|
||||
// comparisons to a single character:
|
||||
//
|
||||
template <class BidirectionalIterator>
|
||||
bool operator == (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
bool <A href="#o61">operator</A> == (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator != (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
bool <A href="#o62">operator</A> != (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator < (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
bool <A href="#o63">operator</A> < (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator > (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
bool <A href="#o64">operator</A> > (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator >= (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
bool <A href="#o65">operator</A> >= (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator <= (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
bool <A href="#o66">operator</A> <= (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);
|
||||
|
||||
template <class BidirectionalIterator>
|
||||
bool operator == (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o71">operator</A> == (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator != (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o72">operator</A> != (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator < (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o73">operator</A> < (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator > (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o74">operator</A> > (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o75">operator</A> >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs);
|
||||
template <class BidirectionalIterator>
|
||||
bool operator <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
bool <A href="#o76">operator</A> <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs);
|
||||
//
|
||||
// addition operators:
|
||||
//
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
|
||||
<A href="#o81">operator</A> + (const std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
const sub_match<RandomAccessIterator>& m);
|
||||
template <class RandomAccessIterator, class traits, class Allocator>
|
||||
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
|
||||
<A href="#o82">operator</A> + (const sub_match<RandomAccessIterator>& m,
|
||||
const std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s);
|
||||
template <class RandomAccessIterator> std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
||||
<A href="#o83">operator</A> + (typename iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
const sub_match<RandomAccessIterator>& m);
|
||||
template <class RandomAccessIterator> std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
||||
<A href="#o84">operator</A> + (const sub_match<RandomAccessIterator>& m,
|
||||
typename iterator_traits<RandomAccessIterator>::value_type const * s);
|
||||
template <class RandomAccessIterator>
|
||||
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
||||
<A href="#o85">operator</A> + (typename iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
const sub_match<RandomAccessIterator>& m);
|
||||
template <class RandomAccessIterator>
|
||||
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
||||
<A href="#o86">operator</A> + (const sub_match<RandomAccessIterator>& m,
|
||||
typename iterator_traits<RandomAccessIterator>::value_type const& s);
|
||||
template <class RandomAccessIterator>
|
||||
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
||||
<A href="#o87">operator</A> + (const sub_match<RandomAccessIterator>& m1,
|
||||
const sub_match<RandomAccessIterator>& m2);
|
||||
|
||||
//
|
||||
// stream inserter:
|
||||
//
|
||||
template <class charT, class traits, class BidirectionalIterator>
|
||||
basic_ostream<charT, traits>&
|
||||
operator << (basic_ostream<charT, traits>& os,
|
||||
<A href="#oi">operator</A> << (basic_ostream<charT, traits>& os,
|
||||
const sub_match<BidirectionalIterator>& m);
|
||||
|
||||
} // namespace boost</PRE>
|
||||
@ -225,188 +271,278 @@ basic_ostream<charT, traits>&
|
||||
<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<value_type>()const;</PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>(matched ? basic_string<value_type>(first,
|
||||
second) : basic_string<value_type>()).</P></CODE><PRE>basic_string<value_type> str()const;</PRE>
|
||||
|
||||
<P><B>
|
||||
Effects: </B>returns <CODE>(matched ? basic_string<value_type>(first,
|
||||
second) : basic_string<value_type>())</CODE>.</P><PRE>int compare(const sub_match& s)const;</PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>str().compare(s.str())</CODE>.</P><PRE>int compare(const basic_string<value_type>& 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<value_type>()const;</PRE>
|
||||
<P>
|
||||
<B>Effects: </B>converts *this into a string: returns <CODE>(matched ?
|
||||
basic_string<value_type>(first, second) :
|
||||
basic_string<value_type>()).</P>
|
||||
</CODE><PRE><A name=m4></A>basic_string<value_type> str()const;</PRE>
|
||||
<P><B> Effects: </B>returns a string representation of *this: <CODE>(matched ?
|
||||
basic_string<value_type>(first, second) :
|
||||
basic_string<value_type>())</CODE>.</P>
|
||||
<PRE><A name=m5></A>int compare(const sub_match& 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<value_type>& s)const;</PRE>
|
||||
<P><B> Effects: </B>compares *this to the string s: returns <CODE>str().compare(s)</CODE>.</P>
|
||||
<PRE><A name=m7></A>int compare(const value_type* s)const;</PRE>
|
||||
<P>
|
||||
<B>Effects:<B></B> </B>compares *this to the null-terminated string <EM>s</EM>:<B> </B>returns
|
||||
<CODE>str().compare(s)</CODE>.</P>
|
||||
<H4>
|
||||
sub_match non-member operators</H4>
|
||||
<PRE>template <class BidirectionalIterator>
|
||||
<H5>Comparisons against self</H5>
|
||||
<PRE><A name=o11></A>template <class BidirectionalIterator>
|
||||
bool operator == (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.compare(rhs) == 0</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.compare(rhs) == 0</CODE>.</P>
|
||||
<PRE><A name=o12></A>template <class BidirectionalIterator>
|
||||
bool operator != (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.compare(rhs) != 0</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.compare(rhs) != 0</CODE>.</P>
|
||||
<PRE><A name=o13></A>template <class BidirectionalIterator>
|
||||
bool operator < (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.compare(rhs) < 0</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.compare(rhs) < 0</CODE>.</P>
|
||||
<PRE><A name=o14></A>template <class BidirectionalIterator>
|
||||
bool operator <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
|
||||
<P><B>
|
||||
Effects: </B>returns <CODE>lhs.compare(rhs) <= 0</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P><B> Effects: </B>returns <CODE>lhs.compare(rhs) <= 0</CODE>.</P>
|
||||
<PRE><A name=o15></A>template <class BidirectionalIterator>
|
||||
bool operator >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.compare(rhs) >= 0</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.compare(rhs) >= 0</CODE>.</P>
|
||||
<PRE><A name=o16></A>template <class BidirectionalIterator>
|
||||
bool operator > (const sub_match<BidirectionalIterator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.compare(rhs) > 0</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.compare(rhs) > 0</CODE>.</P>
|
||||
<H5>Comparisons with std::basic_string</H5>
|
||||
<pre><A name=o21></A>
|
||||
template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator == (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits,
|
||||
Allocator>& lhs, const sub_match<BidirectionalIterator>& rhs);
|
||||
</pre>
|
||||
<P><B>Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o22></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator != (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o23></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator < (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs < rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o24></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator > (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs > rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o25></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator >= (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs >= rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o26></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator <= (const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs <= rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o31></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator == (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P>
|
||||
<PRE><A name=o32></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator != (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P>
|
||||
<PRE><A name=o33></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator < (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs.str() < rhs</CODE>.</P>
|
||||
<PRE><A name=o34></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator > (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs.str() > rhs</CODE>.</P>
|
||||
<PRE><A name=o35></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs.str() >= rhs</CODE>.</P>
|
||||
<PRE><A name=o36></A>template <class BidirectionalIterator, class traits, class Allocator>
|
||||
bool operator <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
const std::basic_string<iterator_traits<BidirectionalIterator>::value_type, traits, Allocator>& rhs);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>lhs.str() <= rhs</CODE>.</P>
|
||||
<H5>Comparisons with null-terminated strings</H5>
|
||||
<PRE><A name=o41></A>template <class BidirectionalIterator>
|
||||
bool operator == (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o42></A>template <class BidirectionalIterator>
|
||||
bool operator != (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P>
|
||||
<PRE></A><A name=o43></A>template <class BidirectionalIterator>
|
||||
bool operator < (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs < rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs < rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o44></A>template <class BidirectionalIterator>
|
||||
bool operator > (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs > rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs > rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o45></A>template <class BidirectionalIterator>
|
||||
bool operator >= (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs >= rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs >= rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o46></A>template <class BidirectionalIterator>
|
||||
bool operator <= (typename iterator_traits<BidirectionalIterator>::value_type const* lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs <= rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs <= rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o51></A>template <class BidirectionalIterator>
|
||||
bool operator == (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P>
|
||||
<PRE><A name=o52></A>template <class BidirectionalIterator>
|
||||
bool operator != (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P>
|
||||
<PRE><A name=o53></A>template <class BidirectionalIterator>
|
||||
bool operator < (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() < rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() < rhs</CODE>.</P>
|
||||
<PRE><A name=o54></A>template <class BidirectionalIterator>
|
||||
bool operator > (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() > rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() > rhs</CODE>.</P>
|
||||
<PRE><A name=o55></A>template <class BidirectionalIterator>
|
||||
bool operator >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() >= rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() >= rhs</CODE>.</P>
|
||||
<PRE><A name=o56></A>template <class BidirectionalIterator>
|
||||
bool operator <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const* rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() <= rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() <= rhs</CODE>.</P>
|
||||
<H5>Comparisons with a single character</H5>
|
||||
<PRE><A name=o61></A>template <class BidirectionalIterator>
|
||||
bool operator == (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs == rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o62></A>template <class BidirectionalIterator>
|
||||
bool operator != (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs != rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o63></A>template <class BidirectionalIterator>
|
||||
bool operator < (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs < rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs < rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o64></A>template <class BidirectionalIterator>
|
||||
bool operator > (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs > rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs > rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o65></A>template <class BidirectionalIterator>
|
||||
bool operator >= (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs >= rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs >= rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o66></A>template <class BidirectionalIterator>
|
||||
bool operator <= (typename iterator_traits<BidirectionalIterator>::value_type const& lhs,
|
||||
const sub_match<BidirectionalIterator>& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs <= rhs.str()</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs <= rhs.str()</CODE>.</P>
|
||||
<PRE><A name=o71></A>template <class BidirectionalIterator>
|
||||
bool operator == (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() == rhs</CODE>.</P>
|
||||
<PRE><A name=o72></A>template <class BidirectionalIterator>
|
||||
bool operator != (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() != rhs</CODE>.</P>
|
||||
<PRE><A name=o73></A>template <class BidirectionalIterator>
|
||||
bool operator < (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() < rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() < rhs</CODE>.</P>
|
||||
<PRE><A name=o74></A>template <class BidirectionalIterator>
|
||||
bool operator > (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() > rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() > rhs</CODE>.</P>
|
||||
<PRE><A name=o75></A>template <class BidirectionalIterator>
|
||||
bool operator >= (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() >= rhs</CODE>.</P><PRE>template <class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() >= rhs</CODE>.</P>
|
||||
<PRE><A name=o76></A>template <class BidirectionalIterator>
|
||||
bool operator <= (const sub_match<BidirectionalIterator>& lhs,
|
||||
typename iterator_traits<BidirectionalIterator>::value_type const& rhs); </PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>lhs.str() <= rhs</CODE>.</P><PRE>template <class charT, class traits, class BidirectionalIterator>
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>lhs.str() <= 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 <class RandomAccessIterator, class traits, class Allocator>
|
||||
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
|
||||
operator + (const std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s,
|
||||
const sub_match<RandomAccessIterator>& m); </PRE>
|
||||
<P><B>Effects: </B>returns <CODE>s + m.str()</CODE>.</P>
|
||||
<PRE><A name=o82></A>template <class RandomAccessIterator, class traits, class Allocator>
|
||||
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>
|
||||
operator + (const sub_match<RandomAccessIterator>& m,
|
||||
const std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type, traits, Allocator>& s); </PRE>
|
||||
<P><B>Effects: </B>returns <CODE>m.str() + s</CODE>.</P>
|
||||
<PRE><A name=o83></A>template <class RandomAccessIterator> std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (typename iterator_traits<RandomAccessIterator>::value_type const* s,
|
||||
const sub_match<RandomAccessIterator>& m); </PRE>
|
||||
<P><B>Effects: </B>returns <CODE>s + m.str()</CODE>.</P>
|
||||
<PRE><A name=o84></A>template <class RandomAccessIterator> std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (const sub_match<RandomAccessIterator>& m,
|
||||
typename iterator_traits<RandomAccessIterator>::value_type const * s);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>m.str() + s</CODE>.</P>
|
||||
<PRE><A name=o85></A>template <class RandomAccessIterator>
|
||||
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (typename iterator_traits<RandomAccessIterator>::value_type const& s,
|
||||
const sub_match<RandomAccessIterator>& m); </PRE>
|
||||
<P><B>Effects: </B>returns <CODE>s + m.str()</CODE>.</P>
|
||||
<PRE><A name=o86></A>template <class RandomAccessIterator>
|
||||
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (const sub_match<RandomAccessIterator>& m,
|
||||
typename iterator_traits<RandomAccessIterator>::value_type const& s); </PRE>
|
||||
<P><B>Effects: </B>returns <CODE>m.str() + s</CODE>.</P>
|
||||
<PRE><A name=o87></A>template <class RandomAccessIterator>
|
||||
std::basic_string<typename iterator_traits<RandomAccessIterator>::value_type>
|
||||
operator + (const sub_match<RandomAccessIterator>& m1,
|
||||
const sub_match<RandomAccessIterator>& m2);</PRE>
|
||||
<P><B>Effects: </B>returns <CODE>m1.str() + m2.str()</CODE>.</P>
|
||||
<h5>Stream inserter</h5>
|
||||
<PRE><A name=oi></A>template <class charT, class traits, class BidirectionalIterator>
|
||||
basic_ostream<charT, traits>&
|
||||
operator << (basic_ostream<charT, traits>& os
|
||||
const sub_match<BidirectionalIterator>& m);</PRE>
|
||||
|
||||
<P> <B>
|
||||
Effects: </B>returns <CODE>(os << m.str())</CODE>.
|
||||
<P>
|
||||
<B>Effects: </B>returns <CODE>(os << m.str())</CODE>.
|
||||
<HR>
|
||||
<p>Revised
|
||||
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
|
||||
@ -422,5 +558,3 @@ basic_ostream<charT, traits>&
|
||||
for any purpose. It is provided "as is" without express or implied warranty.</I></P>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
@ -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><> 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>
|
||||
|
||||
|
Reference in New Issue
Block a user