3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Function template keep</title>
5 <link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
7 <link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
8 <link rel="up" href="../../xpressive/reference.html#header.boost.xpressive.regex_primitives_hpp" title="Header <boost/xpressive/regex_primitives.hpp>">
9 <link rel="prev" href="repeat.html" title="Function repeat">
10 <link rel="next" href="before.html" title="Function template before">
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
15 <td align="center"><a href="../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../more/index.htm">More</a></td>
22 <div class="spirit-nav">
23 <a accesskey="p" href="repeat.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../xpressive/reference.html#header.boost.xpressive.regex_primitives_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="before.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
25 <div class="refentry">
26 <a name="boost.xpressive.keep"></a><div class="titlepage"></div>
27 <div class="refnamediv">
28 <h2><span class="refentrytitle">Function template keep</span></h2>
29 <p>boost::xpressive::keep — Create an independent sub-expression. </p>
31 <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
32 <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../../xpressive/reference.html#header.boost.xpressive.regex_primitives_hpp" title="Header <boost/xpressive/regex_primitives.hpp>">boost/xpressive/regex_primitives.hpp</a>>
35 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <a class="link" href="../../Expr.html" title="Concept Expr">Expr</a><span class="special">></span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="identifier">keep</span><span class="special">(</span><span class="identifier">Expr</span> <span class="keyword">const</span> <span class="special">&</span> expr<span class="special">)</span><span class="special">;</span></pre></div>
36 <div class="refsect1">
37 <a name="idp537652144"></a><h2>Description</h2>
38 <p>Turn off back-tracking for a sub-expression. Any branches or repeats within the sub-expression will match only one way, and no other alternatives are tried.</p>
39 <div class="note"><table border="0" summary="Note">
41 <td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../doc/src/images/note.png"></td>
42 <th align="left">Note</th>
44 <tr><td align="left" valign="top"><p>keep(expr) is equivalent to the perl (?>...) extension.</p></td></tr>
49 <div class="variablelist"><table border="0" class="variablelist compact">
51 <col align="left" valign="top">
55 <td><p><span class="term">Parameters:</span></p></td>
56 <td><div class="variablelist"><table border="0" class="variablelist compact">
58 <col align="left" valign="top">
62 <td><p><span class="term"><code class="computeroutput">expr</code></span></p></td>
63 <td><p>The sub-expression to modify. </p></td>
70 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
71 <td align="left"></td>
72 <td align="right"><div class="copyright-footer">Copyright © 2007 Eric Niebler<p>
73 Distributed under the Boost Software License, Version 1.0. (See accompanying
74 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
79 <div class="spirit-nav">
80 <a accesskey="p" href="repeat.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../xpressive/reference.html#header.boost.xpressive.regex_primitives_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="before.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>