diff --git a/doc/format_boost_syntax.qbk b/doc/format_boost_syntax.qbk index cba57dd8..c3871041 100644 --- a/doc/format_boost_syntax.qbk +++ b/doc/format_boost_syntax.qbk @@ -33,6 +33,15 @@ order to prevent ambiguities. For example, the format string "(?1foo:bar)" will replace each match found with "foo" if the sub-expression $1 was matched, and with "bar" otherwise. +For sub-expressions with an index greater than 9, or for access to named sub-expressions use: + +?{INDEX}true-expression:false-expression + +or + +?{NAME}true-expression:false-expression + + [h4 Placeholder Sequences] Placeholder sequences specify that some part of what matched the regular expression @@ -41,12 +50,24 @@ should be sent to output as follows: [table [[Placeholder][Meaning]] [[$&][Outputs what matched the whole expression.]] -[[$`][Outputs the text between the end of the last match found (or the - start of the text if no previous match was found), and the start - of the current match.]] +[[$MATCH][As $&]] +[[${^MATCH}][As $&]] +[[$\`][Outputs the text between the end of the last match found (or the + start of the text if no previous match was found), and the start + of the current match.]] +[[$PREMATCH][As $\`]] +[[${^PREMATCH}][As $\`]] [[$'][Outputs all the text following the end of the current match.]] +[[$POSTMATCH][As $']] +[[${^POSTMATCH}][As $']] +[[$+][Outputs what matched the last marked sub-expression in the regular expression.]] +[[$LAST_PAREN_MATCH][As $+]] +[[$LAST_SUBMATCH_RESULT][Outputs what matched the last sub-expression to be actually matched.]] +[[$^N][As $LAST_SUBMATCH_RESULT]] [[$$][Outputs a literal '$']] [[$n][Outputs what matched the n'th sub-expression.]] +[[${n}][Outputs what matched the n'th sub-expression.]] +[[$+{NAME}][Outputs whatever matched the sub-expression named "NAME".]] ] Any $-placeholder sequence not listed above, results in '$' being treated as a literal. diff --git a/doc/html/boost_regex/background_information/examples.html b/doc/html/boost_regex/background_information/examples.html index d551f231..2de70f4d 100644 --- a/doc/html/boost_regex/background_information/examples.html +++ b/doc/html/boost_regex/background_information/examples.html @@ -28,7 +28,7 @@ Example Programs
<boost/regex/user.hpp>
.
@@ -36,7 +36,7 @@ Report on C++ Library Extensions.
@@ -62,7 +62,7 @@ (??{code}) Not implementable in a compiled strongly typed language.
@@ -82,7 +82,7 @@ a custom traits class.
diff --git a/doc/html/boost_regex/captures.html b/doc/html/boost_regex/captures.html index de155209..e1649644 100644 --- a/doc/html/boost_regex/captures.html +++ b/doc/html/boost_regex/captures.html @@ -35,7 +35,7 @@ accessed.
@@ -218,7 +218,7 @@ output stream.
@@ -231,7 +231,7 @@
you can determine which sub-expressions matched by accessing the sub_match::matched
data member.
diff --git a/doc/html/boost_regex/format/boost_format_syntax.html b/doc/html/boost_regex/format/boost_format_syntax.html index 73b7d8ae..4a9b80eb 100644 --- a/doc/html/boost_regex/format/boost_format_syntax.html +++ b/doc/html/boost_regex/format/boost_format_syntax.html @@ -32,7 +32,7 @@ '$', '\', '(', ')', '?', and ':'.
@@ -40,7 +40,7 @@ you want a to output literal parenthesis.
@@ -65,8 +65,21 @@ match found with "foo" if the sub-expression $1 was matched, and with "bar" otherwise.
++ For sub-expressions with an index greater than 9, or for access to named + sub-expressions use: +
++ ?{INDEX}true-expression:false-expression +
++ or +
++ ?{NAME}true-expression:false-expression +
+ $MATCH +
++ As $& +
++ ${^MATCH} +
++ As $& +
+$` @@ -119,6 +156,30 @@
+ $PREMATCH +
++ As $` +
++ ${^PREMATCH} +
++ As $` +
+$' @@ -131,6 +192,79 @@
+ $POSTMATCH +
++ As $' +
++ ${^POSTMATCH} +
++ As $' +
++ $+ +
++ Outputs what matched the last marked sub-expression in the regular + expression. +
++ $LAST_PAREN_MATCH +
++ As $+ +
++ $LAST_SUBMATCH_RESULT +
++ Outputs what matched the last sub-expression to be actually matched. +
++ $^N +
++ As $LAST_SUBMATCH_RESULT +
+$$ @@ -154,6 +288,30 @@
+ ${n} +
++ Outputs what matched the n'th sub-expression. +
++ $+{NAME} +
++ Outputs whatever matched the sub-expression named "NAME". +
+@@ -161,7 +319,7 @@ as a literal.
@@ -58,7 +58,7 @@ started guide for more information.
@@ -302,7 +302,7 @@ see the config library documentation.
@@ -347,7 +347,7 @@ will build v9 variants of the regex library named libboost_regex_v9.a etc.
#include <boost/pattern_except.hpp> @@ -54,7 +54,7 @@ } // namespace boost
regex_error(const std::string& s, regex_constants::error_type err, std::ptrdiff_t pos); diff --git a/doc/html/boost_regex/ref/basic_regex.html b/doc/html/boost_regex/ref/basic_regex.html index 6b6340eb..c009b8d5 100644 --- a/doc/html/boost_regex/ref/basic_regex.html +++ b/doc/html/boost_regex/ref/basic_regex.html @@ -27,7 +27,7 @@ basic_regex- + Synopsis
#include <boost/regex.hpp> @@ -244,7 +244,7 @@ } // namespace boost- + Description
@@ -327,7 +327,7 @@
basic_regex
.-Table 1. basic_regex default construction postconditions
+Table 1. basic_regex default construction postconditions
@@ -407,7 +407,7 @@ flags specified in f. -Table 2. Postconditions for basic_regex construction
+Table 2. Postconditions for basic_regex construction
@@ -512,7 +512,7 @@ specified in f. -Table 3. Postconditions for basic_regex construction
+Table 3. Postconditions for basic_regex construction
@@ -616,7 +616,7 @@ according the option flags specified in f. -Table 4. Postconditions for basic_regex construction
+Table 4. Postconditions for basic_regex construction
@@ -727,7 +727,7 @@ flags specified in f. -Table 5. Postconditions for basic_regex construction
+Table 5. Postconditions for basic_regex construction
@@ -829,7 +829,7 @@ flags specified in f. -Table 6. Postconditions for basic_regex construction
+Table 6. Postconditions for basic_regex construction
@@ -1043,7 +1043,7 @@ in f. -Table 7. Postconditions for basic_regex::assign
+Table 7. Postconditions for basic_regex::assign
diff --git a/doc/html/boost_regex/ref/concepts/traits_concept.html b/doc/html/boost_regex/ref/concepts/traits_concept.html index 224279f6..6d159362 100644 --- a/doc/html/boost_regex/ref/concepts/traits_concept.html +++ b/doc/html/boost_regex/ref/concepts/traits_concept.html @@ -34,7 +34,7 @@ Boost-specific enhanced interface. - + Minimal requirements.
@@ -381,7 +381,7 @@- + Additional Optional Requirements
diff --git a/doc/html/boost_regex/ref/deprecated_interfaces/regex_format.html b/doc/html/boost_regex/ref/deprecated_interfaces/regex_format.html index d613605c..07a47ad4 100644 --- a/doc/html/boost_regex/ref/deprecated_interfaces/regex_format.html +++ b/doc/html/boost_regex/ref/deprecated_interfaces/regex_format.html @@ -34,7 +34,7 @@ previous version of Boost.Regex and will not be further updated:- + Algorithm regex_format
diff --git a/doc/html/boost_regex/ref/error_type.html b/doc/html/boost_regex/ref/error_type.html index 4c8d7a3f..7923d13c 100644 --- a/doc/html/boost_regex/ref/error_type.html +++ b/doc/html/boost_regex/ref/error_type.html @@ -27,7 +27,7 @@ error_type- + Synopsis
@@ -57,7 +57,7 @@ } // namespace boost
- + Description
diff --git a/doc/html/boost_regex/ref/match_flag_type.html b/doc/html/boost_regex/ref/match_flag_type.html index d515cb48..4be97bd4 100644 --- a/doc/html/boost_regex/ref/match_flag_type.html +++ b/doc/html/boost_regex/ref/match_flag_type.html @@ -69,7 +69,7 @@ } // namespace boost
- + Description
diff --git a/doc/html/boost_regex/ref/match_results.html b/doc/html/boost_regex/ref/match_results.html index 7b674765..ac2057f0 100644 --- a/doc/html/boost_regex/ref/match_results.html +++ b/doc/html/boost_regex/ref/match_results.html @@ -27,7 +27,7 @@ match_results
- + Synopsis
#include <boost/regex.hpp> @@ -166,7 +166,7 @@ match_results<BidirectionalIterator, Allocator>& m2);- + Description
diff --git a/doc/html/boost_regex/ref/non_std_strings/icu/unicode_algo.html b/doc/html/boost_regex/ref/non_std_strings/icu/unicode_algo.html index 732889c4..79bbe08d 100644 --- a/doc/html/boost_regex/ref/non_std_strings/icu/unicode_algo.html +++ b/doc/html/boost_regex/ref/non_std_strings/icu/unicode_algo.html @@ -43,7 +43,7 @@ on to the "real" algorithm.
- + u32regex_match
- + u32regex_search
- + u32regex_replace
diff --git a/doc/html/boost_regex/ref/non_std_strings/icu/unicode_iter.html b/doc/html/boost_regex/ref/non_std_strings/icu/unicode_iter.html index 6c781423..6f6698a3 100644 --- a/doc/html/boost_regex/ref/non_std_strings/icu/unicode_iter.html +++ b/doc/html/boost_regex/ref/non_std_strings/icu/unicode_iter.html @@ -28,7 +28,7 @@ Unicode Aware Regex Iterators
- + u32regex_iterator
@@ -126,7 +126,7 @@ Provided of course that the input is encoded as UTF-8.
- + u32regex_token_iterator
diff --git a/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_algo.html b/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_algo.html index 11f9d1ea..48f67005 100644 --- a/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_algo.html +++ b/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_algo.html @@ -34,7 +34,7 @@ here they are anyway:
- + regex_match
- + regex_match (second overload)
@@ -110,7 +110,7 @@ }- + regex_search
- + regex_search (second overload)
@@ -164,7 +164,7 @@ + s.GetLength(), e, f);- + regex_replace
diff --git a/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_iter.html b/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_iter.html index 6f3d7ddf..27380fa3 100644 --- a/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_iter.html +++ b/doc/html/boost_regex/ref/non_std_strings/mfc_strings/mfc_iter.html @@ -32,7 +32,7 @@ an MFC/ATL string to a
regex_iterator
orregex_token_iterator
:- + regex_iterator creation helper
@@ -68,7 +68,7 @@ }- + regex_token_iterator creation helpers
diff --git a/doc/html/boost_regex/ref/posix.html b/doc/html/boost_regex/ref/posix.html index b173b48e..916e4a24 100644 --- a/doc/html/boost_regex/ref/posix.html +++ b/doc/html/boost_regex/ref/posix.html @@ -165,7 +165,7 @@
- + regcomp
- + regerror
- + regexec
- + regfree
diff --git a/doc/html/boost_regex/ref/regex_iterator.html b/doc/html/boost_regex/ref/regex_iterator.html index 17494ce8..6cb4652a 100644 --- a/doc/html/boost_regex/ref/regex_iterator.html +++ b/doc/html/boost_regex/ref/regex_iterator.html @@ -78,7 +78,7 @@ regex_constants::match_flag_type m = regex_constants::match_default);
- + Description
@@ -436,7 +436,7 @@ m.
- + Examples
diff --git a/doc/html/boost_regex/ref/regex_match.html b/doc/html/boost_regex/ref/regex_match.html index 9c4413f1..9e58948d 100644 --- a/doc/html/boost_regex/ref/regex_match.html +++ b/doc/html/boost_regex/ref/regex_match.html @@ -80,7 +80,7 @@ match_flag_type flags = match_default);
- + Description
template <class BidirectionalIterator, class Allocator, class charT, class traits> @@ -360,7 +360,7 @@ Effects: Returns the result ofregex_match(s.begin(), s.end(), e, flags)
.- + Examples
diff --git a/doc/html/boost_regex/ref/regex_replace.html b/doc/html/boost_regex/ref/regex_replace.html index 5019aeac..eb2b081f 100644 --- a/doc/html/boost_regex/ref/regex_replace.html +++ b/doc/html/boost_regex/ref/regex_replace.html @@ -53,7 +53,7 @@ match_flag_type flags = match_default);
- + Description
template <class OutputIterator, class BidirectionalIterator, class traits, class charT> @@ -163,7 +163,7 @@ and then returnsresult
.- + Examples
diff --git a/doc/html/boost_regex/ref/regex_search.html b/doc/html/boost_regex/ref/regex_search.html index bcf9ce4f..9ab5b031 100644 --- a/doc/html/boost_regex/ref/regex_search.html +++ b/doc/html/boost_regex/ref/regex_search.html @@ -73,7 +73,7 @@ match_flag_type flags = match_default);
- + Description
template <class BidirectionalIterator, class Allocator, class charT, class traits> @@ -355,7 +355,7 @@ Effects: Returns the result ofregex_search(s.begin(), s.end(), e, flags)
.- + Examples
diff --git a/doc/html/boost_regex/ref/regex_token_iterator.html b/doc/html/boost_regex/ref/regex_token_iterator.html index 58683e16..7ce064f0 100644 --- a/doc/html/boost_regex/ref/regex_token_iterator.html +++ b/doc/html/boost_regex/ref/regex_token_iterator.html @@ -136,7 +136,7 @@ regex_constants::match_flag_type m = regex_constants::match_default);
- + Description
@@ -383,7 +383,7 @@ m.
- + Examples
diff --git a/doc/html/boost_regex/ref/regex_traits.html b/doc/html/boost_regex/ref/regex_traits.html index 62cded54..88c599ce 100644 --- a/doc/html/boost_regex/ref/regex_traits.html +++ b/doc/html/boost_regex/ref/regex_traits.html @@ -46,7 +46,7 @@ } // namespace boost
- + Description
diff --git a/doc/html/boost_regex/ref/sub_match.html b/doc/html/boost_regex/ref/sub_match.html index db25820f..ab42cbe1 100644 --- a/doc/html/boost_regex/ref/sub_match.html +++ b/doc/html/boost_regex/ref/sub_match.html @@ -329,11 +329,11 @@ } // namespace boost
- + Description
- + Members
- + sub_match non-member operators
@@ -1008,7 +1008,7 @@ + m2.str().- + Stream inserter
diff --git a/doc/html/boost_regex/syntax/basic_extended.html b/doc/html/boost_regex/syntax/basic_extended.html index 389a5933..f3a7175d 100644 --- a/doc/html/boost_regex/syntax/basic_extended.html +++ b/doc/html/boost_regex/syntax/basic_extended.html @@ -28,7 +28,7 @@ Expression Syntax
- + Synopsis
- + POSIX Extended Syntax
@@ -56,7 +56,7 @@.[{()\*+?|^$- + Wildcard:
- + Anchors:
@@ -86,7 +86,7 @@ of an expression, or the last character of a sub-expression.
- + Marked sub-expressions:
@@ -98,7 +98,7 @@ to by a back-reference.- + Repeats:
@@ -184,7 +184,7 @@ cab operator to be applied to.
- + Back references:
@@ -214,7 +214,7 @@ cab
- + Alternation
@@ -227,7 +227,7 @@ cab will match either of "abd" or "abef".
- + Character sets:
@@ -240,7 +240,7 @@ cab A bracket expression may contain any combination of the following:- + Single characters:
@@ -249,7 +249,7 @@ cab or 'c'.- + Character ranges:
@@ -265,7 +265,7 @@ cab the code points of the characters only.- + Negation:
@@ -274,7 +274,7 @@ cab range
a-c
.- + Character classes:
@@ -284,7 +284,7 @@ cab character class names.- + Collating Elements:
@@ -312,7 +312,7 @@ cab matches a NUL character.- + Equivalence classes:
@@ -329,7 +329,7 @@ cab or even all locales on one platform.- + Combinations:
@@ -337,7 +337,7 @@ cab
[[:digit:]a-c[.NUL.]]
.- + Escapes
@@ -363,7 +363,7 @@ cab extensions are also supported by Boost.Regex:
- + Escapes matching a specific character
@@ -552,7 +552,7 @@ cab- + "Single character" character classes:
@@ -706,7 +706,7 @@ cab- + Character Properties
@@ -813,7 +813,7 @@ cab matches any "digit" character, as does\p{digit}
.- + Word Boundaries
@@ -888,7 +888,7 @@ cab
- + Buffer boundaries
@@ -979,7 +979,7 @@ cab- + Continuation Escape
@@ -991,7 +991,7 @@ cab match to start where the last one ended.- + Quoting escape
@@ -1005,7 +1005,7 @@ cab \*+aaa- + Unicode escapes
@@ -1056,7 +1056,7 @@ cab- + Any other escape
@@ -1065,7 +1065,7 @@ cab \@ matches a literal '@'.- + Operator precedence
@@ -1101,7 +1101,7 @@ cab- + What Gets Matched
@@ -1111,11 +1111,11 @@ cab rule.- + Variations
- + Egrep
@@ -1136,7 +1136,7 @@ cab used with the -E option.
- + awk
@@ -1150,7 +1150,7 @@ cab these by default anyway.
- + Options
@@ -1163,7 +1163,7 @@ cab modify how the case and locale sensitivity are to be applied.
- + References
diff --git a/doc/html/boost_regex/syntax/basic_syntax.html b/doc/html/boost_regex/syntax/basic_syntax.html index 6a6f32d9..266b7d0f 100644 --- a/doc/html/boost_regex/syntax/basic_syntax.html +++ b/doc/html/boost_regex/syntax/basic_syntax.html @@ -28,7 +28,7 @@ Expression Syntax
- + Synopsis
- + POSIX Basic Syntax
@@ -55,7 +55,7 @@.[\*^$- + Wildcard:
- + Anchors:
@@ -85,7 +85,7 @@ of an expression, or the last character of a sub-expression.
- + Marked sub-expressions:
@@ -97,7 +97,7 @@ by a back-reference.- + Repeats:
@@ -155,7 +155,7 @@ aaaa to.
- + Back references:
@@ -173,7 +173,7 @@ aaaa
aaabba- + Character sets:
@@ -186,7 +186,7 @@ aaaa A bracket expression may contain any combination of the following:- + Single characters:
@@ -195,7 +195,7 @@ aaaa or 'c'.- + Character ranges:
@@ -211,7 +211,7 @@ aaaa of the characters only.- + Negation:
@@ -220,7 +220,7 @@ aaaa range a-c.
- + Character classes:
@@ -230,7 +230,7 @@ aaaa character class names.- + Collating Elements:
@@ -259,7 +259,7 @@ aaaa element names.- + Equivalence classes:
@@ -276,7 +276,7 @@ aaaa or even all locales on one platform.- + Combinations:
@@ -284,7 +284,7 @@ aaaa
[[:digit:]a-c[.NUL.]].
- + Escapes
@@ -299,7 +299,7 @@ aaaa will match either a literal '\' or a '^'.
- + What Gets Matched
@@ -309,13 +309,13 @@ aaaa rule.- + Variations
- + Grep
@@ -333,7 +333,7 @@ aaaa As its name suggests, this behavior is consistent with the Unix utility grep.
- + emacs
@@ -613,7 +613,7 @@ aaaa leftmost-longest rule.
- + Options
@@ -627,7 +627,7 @@ aaaa options modify how the case and locale sensitivity are to be applied.
- + References
diff --git a/doc/html/boost_regex/syntax/perl_syntax.html b/doc/html/boost_regex/syntax/perl_syntax.html index add2ff1c..c77eeddb 100644 --- a/doc/html/boost_regex/syntax/perl_syntax.html +++ b/doc/html/boost_regex/syntax/perl_syntax.html @@ -28,7 +28,7 @@ Syntax
- + Synopsis
@@ -43,7 +43,7 @@ boost::regex e2(my_expression, boost::regex::perl|boost::regex::icase);
.[{()\*+?|^$
@@ -83,7 +83,7 @@ A '$' character shall match the end of a line.
@@ -188,7 +188,7 @@ to be applied to.
@@ -360,7 +360,7 @@ named "two".
@@ -387,7 +387,7 @@
(?:abc)??
has exactly the same effect.
@@ -399,7 +399,7 @@ A bracket expression may contain any combination of the following:
@@ -407,7 +407,7 @@ 'b', or 'c'.
@@ -430,7 +430,7 @@
matches any character that is not in the range a-c
.
\0
character.
@@ -500,7 +500,7 @@
[[:digit:]a-c[.NUL.]]
.
\p{digit}
.
@@ -1021,7 +1021,7 @@
\B
Matches only when not at a word boundary.
@@ -1046,7 +1046,7 @@
to the regular expression \n*\z
@@ -1081,7 +1081,7 @@ followed by a sequence of zero or more combining characters.
(?>\x0D\x0A?|[\x0A-\x0C\x85\x{2028}\x{2029}])
.
(?
.
match_results
member functions.
(?# ... )
is treated as a comment, it's contents are ignored.
@@ -1166,7 +1166,7 @@ pattern only.
@@ -1198,7 +1198,7 @@ could be used to validate the password.
@@ -1212,7 +1212,7 @@ (pattern must be of fixed length).
@@ -1463,7 +1463,7 @@
and JScript
are all synonyms for perl
.
@@ -1475,7 +1475,7 @@ are to be applied.
no_mod_s
.
diff --git a/doc/html/boost_regex/unicode.html b/doc/html/boost_regex/unicode.html index b3ceab35..427cb889 100644 --- a/doc/html/boost_regex/unicode.html +++ b/doc/html/boost_regex/unicode.html @@ -30,7 +30,7 @@ There are two ways to use Boost.Regex with Unicode strings:
Copyright © 1998 -2007 John Maddock
Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -196,7 +196,7 @@Last revised: May 06, 2009 at 16:25:16 GMT |
+Last revised: May 09, 2009 at 16:16:54 GMT |