mirror of
https://github.com/boostorg/regex.git
synced 2025-07-01 06:40:57 +02:00
Add checked constructors to the Unicode iterators that need them.
Update icu support code to use the new checking-constructors. Update tests to check the full Unicode character range (as of Unicode V6). Add minimal docs describing the iterators. [SVN r73271]
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>Perl Regular Expression Syntax</title>
|
||||
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
||||
<link rel="home" href="../../index.html" title="Boost.Regex">
|
||||
<link rel="up" href="../syntax.html" title="Regular Expression Syntax">
|
||||
<link rel="prev" href="../syntax.html" title="Regular Expression Syntax">
|
||||
@ -22,13 +22,13 @@
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="../syntax.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../syntax.html"><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="basic_extended.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section" lang="en">
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="boost_regex.syntax.perl_syntax"></a><a class="link" href="perl_syntax.html" title="Perl Regular Expression Syntax">Perl Regular Expression
|
||||
Syntax</a>
|
||||
</h3></div></div></div>
|
||||
<a name="boost_regex.syntax.perl_syntax.synopsis"></a><h4>
|
||||
<a name="id994928"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.synopsis-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.synopsis">Synopsis</a>
|
||||
</h4>
|
||||
<p>
|
||||
@ -36,14 +36,14 @@
|
||||
language Perl . Perl regular expressions are the default behavior in Boost.Regex
|
||||
or you can pass the flag <code class="literal">perl</code> to the <a class="link" href="../ref/basic_regex.html" title="basic_regex"><code class="computeroutput"><span class="identifier">basic_regex</span></code></a> constructor, for example:
|
||||
</p>
|
||||
<pre class="programlisting"><span class="comment">// e1 is a case sensitive Perl regular expression:
|
||||
</span><span class="comment">// since Perl is the default option there's no need to explicitly specify the syntax used here:
|
||||
</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">regex</span> <span class="identifier">e1</span><span class="special">(</span><span class="identifier">my_expression</span><span class="special">);</span>
|
||||
<span class="comment">// e2 a case insensitive Perl regular expression:
|
||||
</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">regex</span> <span class="identifier">e2</span><span class="special">(</span><span class="identifier">my_expression</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">perl</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">icase</span><span class="special">);</span>
|
||||
<pre class="programlisting"><span class="comment">// e1 is a case sensitive Perl regular expression: </span>
|
||||
<span class="comment">// since Perl is the default option there's no need to explicitly specify the syntax used here:</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">regex</span> <span class="identifier">e1</span><span class="special">(</span><span class="identifier">my_expression</span><span class="special">);</span>
|
||||
<span class="comment">// e2 a case insensitive Perl regular expression:</span>
|
||||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">regex</span> <span class="identifier">e2</span><span class="special">(</span><span class="identifier">my_expression</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">perl</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">icase</span><span class="special">);</span>
|
||||
</pre>
|
||||
<a name="boost_regex.syntax.perl_syntax.perl_regular_expression_syntax"></a><h4>
|
||||
<a name="id995076"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.perl_regular_expression_syntax-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.perl_regular_expression_syntax">Perl
|
||||
Regular Expression Syntax</a>
|
||||
</h4>
|
||||
@ -53,27 +53,27 @@
|
||||
</p>
|
||||
<pre class="programlisting">.[{}()\*+?|^$</pre>
|
||||
<a name="boost_regex.syntax.perl_syntax.wildcard"></a><h5>
|
||||
<a name="id995100"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.wildcard-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.wildcard">Wildcard</a>
|
||||
</h5>
|
||||
<p>
|
||||
The single character '.' when used outside of a character set will match
|
||||
any single character except:
|
||||
</p>
|
||||
<div class="itemizedlist"><ul type="disc">
|
||||
<li>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
The NULL character when the <a class="link" href="../ref/match_flag_type.html" title="match_flag_type">flag
|
||||
<code class="literal">match_not_dot_null</code></a> is passed to the matching
|
||||
algorithms.
|
||||
</li>
|
||||
<li>
|
||||
<li class="listitem">
|
||||
The newline character when the <a class="link" href="../ref/match_flag_type.html" title="match_flag_type">flag
|
||||
<code class="literal">match_not_dot_newline</code></a> is passed to the matching
|
||||
algorithms.
|
||||
</li>
|
||||
</ul></div>
|
||||
<a name="boost_regex.syntax.perl_syntax.anchors"></a><h5>
|
||||
<a name="id995154"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.anchors-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.anchors">Anchors</a>
|
||||
</h5>
|
||||
<p>
|
||||
@ -83,7 +83,7 @@
|
||||
A '$' character shall match the end of a line.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.marked_sub_expressions"></a><h5>
|
||||
<a name="id995175"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.marked_sub_expressions-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.marked_sub_expressions">Marked
|
||||
sub-expressions</a>
|
||||
</h5>
|
||||
@ -94,7 +94,7 @@
|
||||
can also repeated, or referred to by a back-reference.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.non_marking_grouping"></a><h5>
|
||||
<a name="id995202"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.non_marking_grouping-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.non_marking_grouping">Non-marking
|
||||
grouping</a>
|
||||
</h5>
|
||||
@ -107,7 +107,7 @@
|
||||
without splitting out any separate sub-expressions.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.repeats"></a><h5>
|
||||
<a name="id995238"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.repeats-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.repeats">Repeats</a>
|
||||
</h5>
|
||||
<p>
|
||||
@ -188,7 +188,7 @@
|
||||
to be applied to.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.non_greedy_repeats"></a><h5>
|
||||
<a name="id995474"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.non_greedy_repeats-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.non_greedy_repeats">Non greedy
|
||||
repeats</a>
|
||||
</h5>
|
||||
@ -218,7 +218,7 @@
|
||||
while consuming as little input as possible.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.possessive_repeats"></a><h5>
|
||||
<a name="id995533"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.possessive_repeats-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.possessive_repeats">Possessive
|
||||
repeats</a>
|
||||
</h5>
|
||||
@ -250,7 +250,7 @@
|
||||
while giving nothing back.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.back_references"></a><h5>
|
||||
<a name="id995592"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.back_references-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.back_references">Back references</a>
|
||||
</h5>
|
||||
<p>
|
||||
@ -360,7 +360,7 @@
|
||||
named "two".
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.alternation"></a><h5>
|
||||
<a name="id995818"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.alternation-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.alternation">Alternation</a>
|
||||
</h5>
|
||||
<p>
|
||||
@ -387,7 +387,7 @@
|
||||
<code class="literal">(?:abc)??</code> has exactly the same effect.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.character_sets"></a><h5>
|
||||
<a name="id995887"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.character_sets-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.character_sets">Character sets</a>
|
||||
</h5>
|
||||
<p>
|
||||
@ -399,38 +399,36 @@
|
||||
A bracket expression may contain any combination of the following:
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.single_characters"></a><h6>
|
||||
<a name="id995918"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.single_characters-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.single_characters">Single characters</a>
|
||||
</h6>
|
||||
<p>
|
||||
For example <code class="literal">[abc]</code>, will match any of the characters 'a',
|
||||
'b', or 'c'.
|
||||
For example =[abc]=, will match any of the characters 'a', 'b', or 'c'.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.character_ranges"></a><h6>
|
||||
<a name="id995940"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.character_ranges-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.character_ranges">Character
|
||||
ranges</a>
|
||||
</h6>
|
||||
<p>
|
||||
For example <code class="literal">[a-c]</code> will match any single character in the
|
||||
range 'a' to 'c'. By default, for Perl regular expressions, a character x
|
||||
is within the range y to z, if the code point of the character lies within
|
||||
the codepoints of the endpoints of the range. Alternatively, if you set the
|
||||
<a class="link" href="../ref/syntax_option_type/syntax_option_type_perl.html" title="Options for Perl Regular Expressions"><code class="literal">collate</code>
|
||||
For example =[a-c]= will match any single character in the range 'a' to 'c'.
|
||||
By default, for Perl regular expressions, a character x is within the range
|
||||
y to z, if the code point of the character lies within the codepoints of
|
||||
the endpoints of the range. Alternatively, if you set the <a class="link" href="../ref/syntax_option_type/syntax_option_type_perl.html" title="Options for Perl Regular Expressions"><code class="literal">collate</code>
|
||||
flag</a> when constructing the regular expression, then ranges are locale
|
||||
sensitive.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.negation"></a><h6>
|
||||
<a name="id995972"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.negation-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.negation">Negation</a>
|
||||
</h6>
|
||||
<p>
|
||||
If the bracket-expression begins with the ^ character, then it matches the
|
||||
complement of the characters it contains, for example <code class="literal">[^a-c]</code>
|
||||
complement of the characters it contains, for example =<code class="literal">a-c</code>=
|
||||
matches any character that is not in the range <code class="literal">a-c</code>.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.character_classes"></a><h6>
|
||||
<a name="id996000"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.character_classes-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.character_classes">Character
|
||||
classes</a>
|
||||
</h6>
|
||||
@ -441,7 +439,7 @@
|
||||
class names</a>.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.collating_elements"></a><h6>
|
||||
<a name="id996032"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.collating_elements-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.collating_elements">Collating
|
||||
Elements</a>
|
||||
</h6>
|
||||
@ -463,7 +461,7 @@
|
||||
matches a <code class="literal">\0</code> character.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.equivalence_classes"></a><h6>
|
||||
<a name="id996094"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.equivalence_classes-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.equivalence_classes">Equivalence
|
||||
classes</a>
|
||||
</h6>
|
||||
@ -480,7 +478,7 @@
|
||||
or even all locales on one platform.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.escaped_characters"></a><h6>
|
||||
<a name="id996142"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.escaped_characters-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.escaped_characters">Escaped
|
||||
Characters</a>
|
||||
</h6>
|
||||
@ -492,7 +490,7 @@
|
||||
is <span class="emphasis"><em>not</em></span> a "word" character.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.combinations"></a><h6>
|
||||
<a name="id996211"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.combinations-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.combinations">Combinations</a>
|
||||
</h6>
|
||||
<p>
|
||||
@ -500,7 +498,7 @@
|
||||
<code class="literal">[[:digit:]a-c[.NUL.]]</code>.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.escapes"></a><h5>
|
||||
<a name="id996232"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.escapes-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.escapes">Escapes</a>
|
||||
</h5>
|
||||
<p>
|
||||
@ -692,7 +690,7 @@
|
||||
</tbody>
|
||||
</table></div>
|
||||
<a name="boost_regex.syntax.perl_syntax._quot_single_character_quot__character_classes_"></a><h6>
|
||||
<a name="id996637"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax._quot_single_character_quot__character_classes_-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax._quot_single_character_quot__character_classes_">"Single
|
||||
character" character classes:</a>
|
||||
</h6>
|
||||
@ -894,7 +892,7 @@
|
||||
</tbody>
|
||||
</table></div>
|
||||
<a name="boost_regex.syntax.perl_syntax.character_properties"></a><h6>
|
||||
<a name="id997326"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.character_properties-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.character_properties">Character
|
||||
Properties</a>
|
||||
</h6>
|
||||
@ -1002,7 +1000,7 @@
|
||||
as does <code class="literal">\p{digit}</code>.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.word_boundaries"></a><h6>
|
||||
<a name="id997626"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.word_boundaries-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.word_boundaries">Word Boundaries</a>
|
||||
</h6>
|
||||
<p>
|
||||
@ -1021,7 +1019,7 @@
|
||||
<code class="literal">\B</code> Matches only when not at a word boundary.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.buffer_boundaries"></a><h6>
|
||||
<a name="id997678"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.buffer_boundaries-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.buffer_boundaries">Buffer boundaries</a>
|
||||
</h6>
|
||||
<p>
|
||||
@ -1036,7 +1034,7 @@
|
||||
\' Matches at the end of a buffer only.
|
||||
</p>
|
||||
<p>
|
||||
\A Matches at the start of a buffer only (the same as <code class="literal">\\\`</code>).
|
||||
\A Matches at the start of a buffer only (the same as =\`=).
|
||||
</p>
|
||||
<p>
|
||||
\z Matches at the end of a buffer only (the same as <code class="literal">\\'</code>).
|
||||
@ -1048,7 +1046,7 @@
|
||||
<code class="literal">(?=\n?\z)</code>.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.continuation_escape"></a><h6>
|
||||
<a name="id997735"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.continuation_escape-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.continuation_escape">Continuation
|
||||
Escape</a>
|
||||
</h6>
|
||||
@ -1060,7 +1058,7 @@
|
||||
one ended.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.quoting_escape"></a><h6>
|
||||
<a name="id997757"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.quoting_escape-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.quoting_escape">Quoting escape</a>
|
||||
</h6>
|
||||
<p>
|
||||
@ -1073,7 +1071,7 @@
|
||||
<span class="special">\*+</span><span class="identifier">aaa</span>
|
||||
</pre>
|
||||
<a name="boost_regex.syntax.perl_syntax.unicode_escapes"></a><h6>
|
||||
<a name="id997804"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.unicode_escapes-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.unicode_escapes">Unicode escapes</a>
|
||||
</h6>
|
||||
<p>
|
||||
@ -1083,7 +1081,7 @@
|
||||
followed by a sequence of zero or more combining characters.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.matching_line_endings"></a><h6>
|
||||
<a name="id997830"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.matching_line_endings-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.matching_line_endings">Matching
|
||||
Line Endings</a>
|
||||
</h6>
|
||||
@ -1092,7 +1090,7 @@
|
||||
sequence, specifically it is identical to the expression <code class="literal">(?>\x0D\x0A?|[\x0A-\x0C\x85\x{2028}\x{2029}])</code>.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.keeping_back_some_text"></a><h6>
|
||||
<a name="id997856"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.keeping_back_some_text-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.keeping_back_some_text">Keeping
|
||||
back some text</a>
|
||||
</h6>
|
||||
@ -1107,7 +1105,7 @@
|
||||
This can be used to simulate variable width lookbehind assertions.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.any_other_escape"></a><h6>
|
||||
<a name="id997886"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.any_other_escape-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.any_other_escape">Any other
|
||||
escape</a>
|
||||
</h6>
|
||||
@ -1116,7 +1114,7 @@
|
||||
\@ matches a literal '@'.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.perl_extended_patterns"></a><h5>
|
||||
<a name="id997903"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.perl_extended_patterns-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.perl_extended_patterns">Perl
|
||||
Extended Patterns</a>
|
||||
</h5>
|
||||
@ -1125,7 +1123,7 @@
|
||||
<code class="literal">(?</code>.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.named_subexpressions"></a><h6>
|
||||
<a name="id997925"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.named_subexpressions-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.named_subexpressions">Named
|
||||
Subexpressions</a>
|
||||
</h6>
|
||||
@ -1147,14 +1145,14 @@
|
||||
format string for search and replace operations, or in the <a class="link" href="../ref/match_results.html" title="match_results"><code class="computeroutput"><span class="identifier">match_results</span></code></a> member functions.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.comments"></a><h6>
|
||||
<a name="id998020"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.comments-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.comments">Comments</a>
|
||||
</h6>
|
||||
<p>
|
||||
<code class="literal">(?# ... )</code> is treated as a comment, it's contents are ignored.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.modifiers"></a><h6>
|
||||
<a name="id998042"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.modifiers-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.modifiers">Modifiers</a>
|
||||
</h6>
|
||||
<p>
|
||||
@ -1168,7 +1166,7 @@
|
||||
pattern only.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.non_marking_groups"></a><h6>
|
||||
<a name="id998077"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.non_marking_groups-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.non_marking_groups">Non-marking
|
||||
groups</a>
|
||||
</h6>
|
||||
@ -1177,7 +1175,7 @@
|
||||
an additional sub-expression.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.branch_reset"></a><h6>
|
||||
<a name="id998099"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.branch_reset-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.branch_reset">Branch reset</a>
|
||||
</h6>
|
||||
<p>
|
||||
@ -1199,7 +1197,7 @@
|
||||
# 1 2 2 3 2 3 4
|
||||
</pre>
|
||||
<a name="boost_regex.syntax.perl_syntax.lookahead"></a><h6>
|
||||
<a name="id998136"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.lookahead-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.lookahead">Lookahead</a>
|
||||
</h6>
|
||||
<p>
|
||||
@ -1222,7 +1220,7 @@
|
||||
could be used to validate the password.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.lookbehind"></a><h6>
|
||||
<a name="id998210"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.lookbehind-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.lookbehind">Lookbehind</a>
|
||||
</h6>
|
||||
<p>
|
||||
@ -1236,7 +1234,7 @@
|
||||
(pattern must be of fixed length).
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.independent_sub_expressions"></a><h6>
|
||||
<a name="id998243"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.independent_sub_expressions-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.independent_sub_expressions">Independent
|
||||
sub-expressions</a>
|
||||
</h6>
|
||||
@ -1249,7 +1247,7 @@
|
||||
no match is found at all.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.recursive_expressions"></a><h6>
|
||||
<a name="id998274"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.recursive_expressions-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.recursive_expressions">Recursive
|
||||
Expressions</a>
|
||||
</h6>
|
||||
@ -1276,7 +1274,7 @@
|
||||
<code class="literal">(?&NAME)</code> recurses to named sub-expression <span class="emphasis"><em>NAME</em></span>.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.conditional_expressions"></a><h6>
|
||||
<a name="id998383"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.conditional_expressions-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.conditional_expressions">Conditional
|
||||
Expressions</a>
|
||||
</h6>
|
||||
@ -1298,27 +1296,27 @@
|
||||
<p>
|
||||
Here is a summary of the possible predicates:
|
||||
</p>
|
||||
<div class="itemizedlist"><ul type="disc">
|
||||
<li>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem">
|
||||
<code class="literal">(?(?=assert)yes-pattern|no-pattern)</code> Executes <span class="emphasis"><em>yes-pattern</em></span>
|
||||
if the forward look-ahead assert matches, otherwise executes <span class="emphasis"><em>no-pattern</em></span>.
|
||||
</li>
|
||||
<li>
|
||||
<li class="listitem">
|
||||
<code class="literal">(?(?!assert)yes-pattern|no-pattern)</code> Executes <span class="emphasis"><em>yes-pattern</em></span>
|
||||
if the forward look-ahead assert does not match, otherwise executes
|
||||
<span class="emphasis"><em>no-pattern</em></span>.
|
||||
</li>
|
||||
<li>
|
||||
<li class="listitem">
|
||||
<code class="literal">(?(R)yes-pattern|no-pattern)</code> Executes <span class="emphasis"><em>yes-pattern</em></span>
|
||||
if we are executing inside a recursion, otherwise executes <span class="emphasis"><em>no-pattern</em></span>.
|
||||
</li>
|
||||
<li>
|
||||
<li class="listitem">
|
||||
<code class="literal">(?(R<span class="emphasis"><em>N</em></span>)yes-pattern|no-pattern)</code>
|
||||
Executes <span class="emphasis"><em>yes-pattern</em></span> if we are executing inside
|
||||
a recursion to sub-expression <span class="emphasis"><em>N</em></span>, otherwise executes
|
||||
<span class="emphasis"><em>no-pattern</em></span>.
|
||||
</li>
|
||||
<li>
|
||||
<li class="listitem">
|
||||
<code class="literal">(?(DEFINE)never-exectuted-pattern)</code> Defines a block
|
||||
of code that is never executed and matches no characters: this is usually
|
||||
used to define one or more named sub-expressions which are refered to
|
||||
@ -1326,42 +1324,42 @@
|
||||
</li>
|
||||
</ul></div>
|
||||
<a name="boost_regex.syntax.perl_syntax.operator_precedence"></a><h5>
|
||||
<a name="id998543"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.operator_precedence-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.operator_precedence">Operator
|
||||
precedence</a>
|
||||
</h5>
|
||||
<p>
|
||||
The order of precedence for of operators is as follows:
|
||||
</p>
|
||||
<div class="orderedlist"><ol type="1">
|
||||
<li>
|
||||
<div class="orderedlist"><ol class="orderedlist" type="1">
|
||||
<li class="listitem">
|
||||
Collation-related bracket symbols <code class="computeroutput"><span class="special">[==]</span>
|
||||
<span class="special">[::]</span> <span class="special">[..]</span></code>
|
||||
</li>
|
||||
<li>
|
||||
<li class="listitem">
|
||||
Escaped characters <code class="literal">\</code>
|
||||
</li>
|
||||
<li>
|
||||
<li class="listitem">
|
||||
Character set (bracket expression) <code class="computeroutput"><span class="special">[]</span></code>
|
||||
</li>
|
||||
<li>
|
||||
<li class="listitem">
|
||||
Grouping <code class="literal">()</code>
|
||||
</li>
|
||||
<li>
|
||||
<li class="listitem">
|
||||
Single-character-ERE duplication <code class="literal">* + ? {m,n}</code>
|
||||
</li>
|
||||
<li>
|
||||
<li class="listitem">
|
||||
Concatenation
|
||||
</li>
|
||||
<li>
|
||||
<li class="listitem">
|
||||
Anchoring ^$
|
||||
</li>
|
||||
<li>
|
||||
<li class="listitem">
|
||||
Alternation |
|
||||
</li>
|
||||
</ol></div>
|
||||
<a name="boost_regex.syntax.perl_syntax.what_gets_matched"></a><h4>
|
||||
<a name="id998662"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.what_gets_matched-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.what_gets_matched">What gets
|
||||
matched</a>
|
||||
</h4>
|
||||
@ -1537,7 +1535,7 @@
|
||||
</tbody>
|
||||
</table></div>
|
||||
<a name="boost_regex.syntax.perl_syntax.variations"></a><h4>
|
||||
<a name="id999034"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.variations-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.variations">Variations</a>
|
||||
</h4>
|
||||
<p>
|
||||
@ -1546,7 +1544,7 @@
|
||||
and <code class="literal">JScript</code></a> are all synonyms for <code class="literal">perl</code>.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.options"></a><h4>
|
||||
<a name="id999080"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.options-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.options">Options</a>
|
||||
</h4>
|
||||
<p>
|
||||
@ -1558,7 +1556,7 @@
|
||||
are to be applied.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.pattern_modifiers"></a><h4>
|
||||
<a name="id999128"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.pattern_modifiers-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.pattern_modifiers">Pattern
|
||||
Modifiers</a>
|
||||
</h4>
|
||||
@ -1570,7 +1568,7 @@
|
||||
and <code class="literal">no_mod_s</code></a>.
|
||||
</p>
|
||||
<a name="boost_regex.syntax.perl_syntax.references"></a><h4>
|
||||
<a name="id1000957"></a>
|
||||
<a name="boost_regex.syntax.perl_syntax.references-heading"></a>
|
||||
<a class="link" href="perl_syntax.html#boost_regex.syntax.perl_syntax.references">References</a>
|
||||
</h4>
|
||||
<p>
|
||||
@ -1579,7 +1577,7 @@
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 1998 -2010 John Maddock<p>
|
||||
<td align="right"><div class="copyright-footer">Copyright © 1998-2010 John Maddock<p>
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
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>)
|
||||
</p>
|
||||
|
Reference in New Issue
Block a user