mirror of
https://github.com/boostorg/regex.git
synced 2025-07-05 08:36:31 +02:00
Merge changes in Trunk.
[SVN r50499]
This commit is contained in:
@ -3,8 +3,8 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>regex_replace</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
|
||||
<link rel="start" href="../../index.html" title="Boost.Regex">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_8125">
|
||||
<link rel="home" href="../../index.html" title="Boost.Regex">
|
||||
<link rel="up" href="../ref.html" title="Reference">
|
||||
<link rel="prev" href="regex_search.html" title="regex_search">
|
||||
<link rel="next" href="regex_iterator.html" title="regex_iterator">
|
||||
@ -24,14 +24,14 @@
|
||||
</div>
|
||||
<div class="section" lang="en">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_regex.ref.regex_replace"></a><a href="regex_replace.html" title="regex_replace"> regex_replace</a>
|
||||
<a name="boost_regex.ref.regex_replace"></a><a class="link" href="regex_replace.html" title="regex_replace"> regex_replace</a>
|
||||
</h3></div></div></div>
|
||||
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">regex</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||||
</pre>
|
||||
<p>
|
||||
The algorithm <a href="regex_replace.html" title="regex_replace"><code class="computeroutput"><span class="identifier">regex_replace</span></code></a> searches through a
|
||||
The algorithm <a class="link" href="regex_replace.html" title="regex_replace"><code class="computeroutput"><span class="identifier">regex_replace</span></code></a> searches through a
|
||||
string finding all the matches to the regular expression: for each match
|
||||
it then calls <a href="match_results.html#boost_regex.match_results_format"><code class="computeroutput"><span class="identifier">match_results</span><span class="special"><>::</span><span class="identifier">format</span></code></a> to format the string and
|
||||
it then calls <a class="link" href="match_results.html#boost_regex.match_results_format"><code class="computeroutput"><span class="identifier">match_results</span><span class="special"><>::</span><span class="identifier">format</span></code></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 <span class="emphasis"><em>flags</em></span>
|
||||
parameter does not have the flag <code class="computeroutput"><span class="identifier">format_no_copy</span></code>
|
||||
@ -53,8 +53,8 @@
|
||||
<span class="identifier">match_flag_type</span> <span class="identifier">flags</span> <span class="special">=</span> <span class="identifier">match_default</span><span class="special">);</span>
|
||||
</pre>
|
||||
<a name="boost_regex.ref.regex_replace.description"></a><h5>
|
||||
<a name="id584361"></a>
|
||||
<a href="regex_replace.html#boost_regex.ref.regex_replace.description">Description</a>
|
||||
<a name="id612131"></a>
|
||||
<a class="link" href="regex_replace.html#boost_regex.ref.regex_replace.description">Description</a>
|
||||
</h5>
|
||||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">OutputIterator</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">BidirectionalIterator</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">traits</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">charT</span><span class="special">></span>
|
||||
<span class="identifier">OutputIterator</span> <span class="identifier">regex_replace</span><span class="special">(</span><span class="identifier">OutputIterator</span> <span class="identifier">out</span><span class="special">,</span>
|
||||
@ -83,17 +83,17 @@
|
||||
<p>
|
||||
The manner in which the format string <span class="emphasis"><em>fmt</em></span> is interpretted,
|
||||
along with the rules used for finding matches, are determined by the flags
|
||||
set in <span class="emphasis"><em>flags</em></span>: see <a href="match_flag_type.html" title="match_flag_type"><code class="computeroutput"><span class="identifier">match_flag_type</span></code></a>.
|
||||
set in <span class="emphasis"><em>flags</em></span>: see <a class="link" href="match_flag_type.html" title="match_flag_type"><code class="computeroutput"><span class="identifier">match_flag_type</span></code></a>.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><strong>Effects</strong></span>: Constructs an <a href="regex_iterator.html" title="regex_iterator"><code class="computeroutput"><span class="identifier">regex_iterator</span></code></a> object:
|
||||
<span class="bold"><strong>Effects</strong></span>: Constructs an <a class="link" href="regex_iterator.html" title="regex_iterator"><code class="computeroutput"><span class="identifier">regex_iterator</span></code></a> object:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="identifier">regex_iterator</span><span class="special"><</span><span class="identifier">BidirectionalIterator</span><span class="special">,</span> <span class="identifier">charT</span><span class="special">,</span> <span class="identifier">traits</span><span class="special">,</span> <span class="identifier">Allocator</span><span class="special">></span>
|
||||
<span class="identifier">i</span><span class="special">(</span><span class="identifier">first</span><span class="special">,</span> <span class="identifier">last</span><span class="special">,</span> <span class="identifier">e</span><span class="special">,</span> <span class="identifier">flags</span><span class="special">),</span>
|
||||
</pre>
|
||||
<p>
|
||||
and uses <span class="emphasis"><em>i</em></span> to enumerate through all of the matches
|
||||
<span class="emphasis"><em>m</em></span> of type <a href="match_results.html" title="match_results"><code class="computeroutput"><span class="identifier">match_results</span></code></a> <code class="computeroutput"><span class="special"><</span><span class="identifier">BidirectionalIterator</span><span class="special">></span></code>
|
||||
<span class="emphasis"><em>m</em></span> of type <a class="link" href="match_results.html" title="match_results"><code class="computeroutput"><span class="identifier">match_results</span></code></a> <code class="computeroutput"><span class="special"><</span><span class="identifier">BidirectionalIterator</span><span class="special">></span></code>
|
||||
that occur within the sequence [first, last).
|
||||
</p>
|
||||
<p>
|
||||
@ -163,8 +163,8 @@
|
||||
and then returns <code class="computeroutput"><span class="identifier">result</span></code>.
|
||||
</p>
|
||||
<a name="boost_regex.ref.regex_replace.examples"></a><h5>
|
||||
<a name="id585910"></a>
|
||||
<a href="regex_replace.html#boost_regex.ref.regex_replace.examples">Examples</a>
|
||||
<a name="id613680"></a>
|
||||
<a class="link" href="regex_replace.html#boost_regex.ref.regex_replace.examples">Examples</a>
|
||||
</h5>
|
||||
<p>
|
||||
The following example takes C/C++ source code as input, and outputs syntax
|
||||
|
Reference in New Issue
Block a user