Contains the definition of the basic_regex<> class template and its associated helper functions. voidbasic_regex< BidiIter > &The first basic_regex object. basic_regex< BidiIter > &The second basic_regex object. Swaps the contents of two basic_regex objects. This is a shallow swap that does not do reference tracking. If you embed a basic_regex object by reference in another regular expression and then swap its contents with another basic_regex object, the change will not be visible to the enclosing regular expression. It is done this way to ensure that swap() cannot throw. Will not throw.
Contains the definition of the match_results type and associated helpers. The match_results type holds the results of a regex_match() or regex_search() operation.
Defines the syntax elements of xpressive's action expressions. A unary metafunction that turns an ordinary function object type into the type of a deferred function object for use in xpressive semantic actions. Use xpressive::function<> to turn an ordinary polymorphic function object type into a type that can be used to declare an object for use in xpressive semantic actions.For example, the global object xpressive::push_back can be used to create deferred actions that have the effect of pushing a value into a container. It is defined with xpressive::function<> as follows:xpressive::function<xpressive::op::push_back>::type const push_back = {}; where op::push_back is an ordinary function object that pushes its second argument into its first. Thus defined, xpressive::push_back can be used in semantic actions as follows:namespace xp = boost::xpressive; using xp::_; std::list<int> result; std::string str("1 23 456 7890"); xp::sregex rx = (+_d)[ xp::push_back(xp::ref(result), xp::as<int>(_) ] >> *(' ' >> (+_d)[ xp::push_back(xp::ref(result), xp::as<int>(_) ) ]); proto::terminal< PolymorphicFunctionObject >::type at is a PolymorphicFunctionObject for indexing into a sequence This(Cont &Idx)Cont::reference This(Cont const &Idx)Cont::const_reference This(ContIdx)Cont::const_reference Cont::referenceCont &The RandomAccessSequence to index into IdxThe index Cont is a model of RandomAccessSequence c[idx] Cont::const_referenceCont const &IdxThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. back is a PolymorphicFunctionObject for fetching the back element of a container. This(Sequence)remove_reference< Sequence >::type mpl::if_c< is_const< sequence_type >::value, typename sequence_type::const_reference, typename sequence_type::reference >::type result< back(Sequence &)>::typeSequence &The sequence from which to fetch the back. seq.back() first is a PolymorphicFunctionObject for fetching the first element of a pair. This(Pair)remove_reference< Pair >::type::first_type Pair::first_typePair const &The pair from which to fetch the first element. p.first front is a PolymorphicFunctionObject for fetching the front element of a container. This(Sequence)remove_reference< Sequence >::type mpl::if_c< is_const< sequence_type >::value, typename sequence_type::const_reference, typename sequence_type::reference >::type result< front(Sequence &)>::typeSequence &The sequence from which to fetch the front. seq.front() insert is a PolymorphicFunctionObject for inserting a value or a sequence of values into a sequence container, an associative container, or a string. unspecified result< insert(Cont &, A0 const &)>::typeCont &A0 const &This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. result< insert(Cont &, A0 const &, A1 const &)>::typeCont &A0 const &A1 const &This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. result< insert(Cont &, A0 const &, A1 const &, A2 const &)>::typeCont &A0 const &A1 const &A2 const &This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. result< insert(Cont &, A0 const &, A1 const &, A2 const &, A3 const &)>::typeCont &The container into which to insert the element(s) A0 const &A value, iterator, or count A1 const &A value, iterator, string, count, or character A2 const &A value, iterator, or count A3 const &A count For the form insert()(cont, a0), return cont.insert(a0). For the form insert()(cont, a0, a1), return cont.insert(a0, a1). For the form insert()(cont, a0, a1, a2), return cont.insert(a0, a1, a2). For the form insert()(cont, a0, a1, a2, a3), return cont.insert(a0, a1, a2, a3). length is a PolymorphicFunctionObject for fetching the length of sub_match. This(Sub)remove_reference< Sub >::type::difference_type Sub::difference_typeSub const &The sub_match object. sub.length() make_pair is a PolymorphicFunctionObject for building a std::pair out of two parameters This(FirstSecond)For exposition only. decay< First >::type For exposition only. decay< Second >::type std::pair< first_type, second_type > std::pair< First, Second >First const &The first element of the pair Second const &The second element of the pair std::make_pair(first, second) matched is a PolymorphicFunctionObject for assessing whether a sub_match object matched or not. bool boolSub const &The sub_match object. sub.matched pop is a PolymorphicFunctionObject for popping an element from a container. void voidSequence &The sequence from which to pop. Equivalent to seq.pop(). void pop_back is a PolymorphicFunctionObject for popping an element from the back of a container. void voidSequence &The sequence from which to pop. Equivalent to seq.pop_back(). void pop_front is a PolymorphicFunctionObject for popping an element from the front of a container. void voidSequence &The sequence from which to pop. Equivalent to seq.pop_front(). void push is a PolymorphicFunctionObject for pushing an element into a container. void voidSequence &The sequence into which the value should be pushed. Value const &The value to push into the sequence. Equivalent to seq.push(val). void push_back is a PolymorphicFunctionObject for pushing an element into the back of a container. void voidSequence &The sequence into which the value should be pushed. Value const &The value to push into the sequence. Equivalent to seq.push_back(val). void push_front is a PolymorphicFunctionObject for pushing an element into the front of a container. void voidSequence &The sequence into which the value should be pushed. Value const &The value to push into the sequence. Equivalent to seq.push_front(val). void second is a PolymorphicFunctionObject for fetching the second element of a pair. This(Pair)remove_reference< Pair >::type::second_type Pair::second_typePair const &The pair from which to fetch the second element. p.second str is a PolymorphicFunctionObject for turning a sub_match into an equivalent std::string. This(Sub)remove_reference< Sub >::type::string_type Sub::string_typeSub const &The sub_match object. sub.str() top is a PolymorphicFunctionObject for fetching the top element of a stack. This(Sequence)remove_reference< Sequence >::type mpl::if_c< is_const< sequence_type >::value, typename sequence_type::value_type const &, typename sequence_type::value_type & >::type result< top(Sequence &)>::typeSequence &The sequence from which to fetch the top. seq.top() unwrap_reference is a PolymorphicFunctionObject for unwrapping a boost::reference_wrapper<>. This(Ref &)boost::unwrap_reference< Ref >::type & This(Ref)boost::unwrap_reference< Ref >::type & T &boost::reference_wrapper< T >The boost::reference_wrapper<T> to unwrap. static_cast<T &>(r) function< op::at >::type constat is a lazy PolymorphicFunctionObject for indexing into a sequence in an xpressive semantic action. function< op::push >::type constpush is a lazy PolymorphicFunctionObject for pushing a value into a container in an xpressive semantic action. function< op::push_back >::type constpush_back is a lazy PolymorphicFunctionObject for pushing a value into a container in an xpressive semantic action. function< op::push_front >::type constpush_front is a lazy PolymorphicFunctionObject for pushing a value into a container in an xpressive semantic action. function< op::pop >::type constpop is a lazy PolymorphicFunctionObject for popping the top element from a sequence in an xpressive semantic action. function< op::pop_back >::type constpop_back is a lazy PolymorphicFunctionObject for popping the back element from a sequence in an xpressive semantic action. function< op::pop_front >::type constpop_front is a lazy PolymorphicFunctionObject for popping the front element from a sequence in an xpressive semantic action. function< op::top >::type consttop is a lazy PolymorphicFunctionObject for accessing the top element from a stack in an xpressive semantic action. function< op::back >::type constback is a lazy PolymorphicFunctionObject for fetching the back element of a sequence in an xpressive semantic action. function< op::front >::type constfront is a lazy PolymorphicFunctionObject for fetching the front element of a sequence in an xpressive semantic action. function< op::first >::type constfirst is a lazy PolymorphicFunctionObject for accessing the first element of a std::pair<> in an xpressive semantic action. function< op::second >::type constsecond is a lazy PolymorphicFunctionObject for accessing the second element of a std::pair<> in an xpressive semantic action. function< op::matched >::type constmatched is a lazy PolymorphicFunctionObject for accessing the matched member of a xpressive::sub_match<> in an xpressive semantic action. function< op::length >::type constlength is a lazy PolymorphicFunctionObject for computing the length of a xpressive::sub_match<> in an xpressive semantic action. function< op::str >::type conststr is a lazy PolymorphicFunctionObject for converting a xpressive::sub_match<> to a std::basic_string<> in an xpressive semantic action. function< op::insert >::type constinsert is a lazy PolymorphicFunctionObject for inserting a value or a range of values into a sequence in an xpressive semantic action. function< op::make_pair >::type constmake_pair is a lazy PolymorphicFunctionObject for making a std::pair<> in an xpressive semantic action. function< op::unwrap_reference >::type constunwrap_reference is a lazy PolymorphicFunctionObject for unwrapping a boost::reference_wrapper<> in an xpressive semantic action. unspecifiedA const &The lazy value to lexically cast. as() is a lazy funtion for lexically casting a parameter to a different type. A lazy object that, when evaluated, lexically casts its argument to the desired type. unspecifiedA const &The lazy value to statically cast. static_cast_ is a lazy funtion for statically casting a parameter to a different type. A lazy object that, when evaluated, statically casts its argument to the desired type. unspecifiedA const &The lazy value to dynamically cast. dynamic_cast_ is a lazy funtion for dynamically casting a parameter to a different type. A lazy object that, when evaluated, dynamically casts its argument to the desired type. unspecifiedA const &The lazy value to const-cast. dynamic_cast_ is a lazy funtion for const-casting a parameter to a different type. A lazy object that, when evaluated, const-casts its argument to the desired type. value< T > constT const &Helper for constructing value<> objects. value<T>(t) reference< T > constT &Helper for constructing reference<> objects. reference<T>(t) reference< T const > constT const &Helper for constructing reference<> objects that store a reference to const. reference<T const>(t) unspecifiedT const &The UnaryPredicate object or Boolean semantic action.For adding user-defined assertions to your regular expressions. A user-defined assertion is a kind of semantic action that evaluates a Boolean lambda and, if it evaluates to false, causes the match to fail at that location in the string. This will cause backtracking, so the match may ultimately succeed.To use check() to specify a user-defined assertion in a regex, use the following syntax:sregex s = (_d >> _d)[check( XXX )]; // XXX is a custom assertion The assertion is evaluated with a sub_match<> object that delineates what part of the string matched the sub-expression to which the assertion was attached.check() can be used with an ordinary predicate that takes a sub_match<> object as follows:// A predicate that is true IFF a sub-match is // either 3 or 6 characters long. struct three_or_six { bool operator()(ssub_match const &sub) const { return sub.length() == 3 || sub.length() == 6; } }; // match words of 3 characters or 6 characters. sregex rx = (bow >> +_w >> eow)[ check(three_or_six()) ] ; Alternately, check() can be used to define inline custom assertions with the same syntax as is used to define semantic actions. The following code is equivalent to above:// match words of 3 characters or 6 characters. sregex rx = (bow >> +_w >> eow)[ check(length(_)==3 || length(_)==6) ] ; Within a custom assertion, _ is a placeholder for the sub_match<> That delineates the part of the string matched by the sub-expression to which the custom assertion was attached. unspecifiedArgBindings const &...A set of argument bindings, where each argument binding is an assignment expression, the left hand side of which must be an instance of placeholder<X> for some X, and the right hand side is an lvalue of type X.For binding local variables to placeholders in semantic actions when constructing a regex_iterator or a regex_token_iterator. xpressive::let() serves the same purpose as match_results::let(); that is, it binds a placeholder to a local value. The purpose is to allow a regex with semantic actions to be defined that refers to objects that do not yet exist. Rather than referring directly to an object, a semantic action can refer to a placeholder, and the value of the placeholder can be specified later with a let expression. The let expression created with let() is passed to the constructor of either regex_iterator or regex_token_iterator.See the section "Referring to Non-Local Variables" in the Users' Guide for more discussion.Example:@code // Define a placeholder for a map object: placeholder<std::map<std::string, int> > _map;// Match a word and an integer, separated by =>, // and then stuff the result into a std::map<> sregex pair = ( (s1= +_w) >> "=>" >> (s2= +_d) ) [ _map[s1] = as<int>(s2) ];// The string to parse std::string str("aaa=>1 bbb=>23 ccc=>456");// Here is the actual map to fill in: std::map<std::string, int> result;// Create a regex_iterator to find all the matches sregex_iterator it(str.begin(), str.end(), pair, let(_map=result)); sregex_iterator end;// step through all the matches, and fill in // the result map while(it != end) ++it;std::cout << result["aaa"] << ' '; std::cout << result["bbb"] << ' '; std::cout << result["ccc"] << ' '; \endcodeThe above code displays:1 23 456 unspecifiedArgs const &...The arguments to the constructor. A lazy funtion for constructing objects objects of the specified type. A lazy object that, when evaluated, returns T(xs...), where xs... is the result of evaluating the lazy arguments args....
Contains the regex_match(), regex_search() and regex_replace() algorithms. boolBidiIterThe beginning of the sequence. BidiIterThe end of the sequence. match_results< BidiIter > &The match_results struct into which the sub_matches will be written basic_regex< BidiIter > const &The regular expression object to use regex_constants::match_flag_typeregex_constants::match_defaultOptional match flags, used to control how the expression is matched against the sequence. (See match_flag_type.) boolBidiIterBidiIterbasic_regex< BidiIter > const &regex_constants::match_flag_typeregex_constants::match_defaultboolChar *match_results< Char * > &basic_regex< Char * > const &regex_constants::match_flag_typeregex_constants::match_defaultboolBidiRange &match_results< BidiIter > &basic_regex< BidiIter > const &regex_constants::match_flag_typeregex_constants::match_defaultunspecified0boolBidiRange const &match_results< BidiIter > &basic_regex< BidiIter > const &regex_constants::match_flag_typeregex_constants::match_defaultunspecified0boolChar *basic_regex< Char * > const &regex_constants::match_flag_typeregex_constants::match_defaultboolBidiRange &basic_regex< BidiIter > const &regex_constants::match_flag_typeregex_constants::match_defaultunspecified0boolBidiRange const &basic_regex< BidiIter > const &regex_constants::match_flag_typeregex_constants::match_defaultunspecified0See if a regex matches a sequence from beginning to end. Determines whether there is an exact match between the regular expression re, and all of the sequence [begin, end). Type BidiIter meets the requirements of a Bidirectional Iterator (24.1.4). [begin,end) denotes a valid iterator range. true if a match is found, false otherwise regex_error on stack exhaustion boolBidiIterThe beginning of the sequence BidiIterThe end of the sequence match_results< BidiIter > &The match_results struct into which the sub_matches will be written basic_regex< BidiIter > const &The regular expression object to use regex_constants::match_flag_typeregex_constants::match_defaultOptional match flags, used to control how the expression is matched against the sequence. (See match_flag_type.) boolBidiIterBidiIterbasic_regex< BidiIter > const &regex_constants::match_flag_typeregex_constants::match_defaultboolChar *match_results< Char * > &basic_regex< Char * > const &regex_constants::match_flag_typeregex_constants::match_defaultboolBidiRange &match_results< BidiIter > &basic_regex< BidiIter > const &regex_constants::match_flag_typeregex_constants::match_defaultunspecified0boolBidiRange const &match_results< BidiIter > &basic_regex< BidiIter > const &regex_constants::match_flag_typeregex_constants::match_defaultunspecified0boolChar *basic_regex< Char * > const &regex_constants::match_flag_typeregex_constants::match_defaultboolBidiRange &basic_regex< BidiIter > const &regex_constants::match_flag_typeregex_constants::match_defaultunspecified0boolBidiRange const &basic_regex< BidiIter > const &regex_constants::match_flag_typeregex_constants::match_defaultunspecified0Determines whether there is some sub-sequence within [begin,end) that matches the regular expression re. Determines whether there is some sub-sequence within [begin,end) that matches the regular expression re. Type BidiIter meets the requirements of a Bidirectional Iterator (24.1.4). [begin,end) denotes a valid iterator range. true if a match is found, false otherwise regex_error on stack exhaustion OutIterOutIterAn output iterator into which the output sequence is written. BidiIterThe beginning of the input sequence. BidiIterThe end of the input sequence. basic_regex< BidiIter > const &The regular expression object to use. Formatter const &The format string used to format the replacement sequence, or a formatter function, function object, or expression. regex_constants::match_flag_typeregex_constants::match_defaultOptional match flags, used to control how the expression is matched against the sequence. (See match_flag_type.) unspecified0OutIterOutIterBidiIterBidiIterbasic_regex< BidiIter > const &typename iterator_value< BidiIter >::type const *regex_constants::match_flag_typeregex_constants::match_defaultBidiContainerBidiContainer &basic_regex< BidiIter > const &Formatter const &regex_constants::match_flag_typeregex_constants::match_defaultunspecified0BidiContainerBidiContainer const &basic_regex< BidiIter > const &Formatter const &regex_constants::match_flag_typeregex_constants::match_defaultunspecified0std::basic_string< typename remove_const< Char >::type >Char *basic_regex< Char * > const &Formatter const &regex_constants::match_flag_typeregex_constants::match_defaultunspecified0BidiContainerBidiContainer &basic_regex< BidiIter > const &typename iterator_value< BidiIter >::type const *regex_constants::match_flag_typeregex_constants::match_defaultunspecified0BidiContainerBidiContainer const &basic_regex< BidiIter > const &typename iterator_value< BidiIter >::type const *regex_constants::match_flag_typeregex_constants::match_defaultunspecified0std::basic_string< typename remove_const< Char >::type >Char *basic_regex< Char * > const &typename add_const< Char >::type *regex_constants::match_flag_typeregex_constants::match_defaultBuild an output sequence given an input sequence, a regex, and a format string or a formatter object, function, or expression. Constructs a regex_iterator object: regex_iterator< BidiIter > i(begin, end, re, flags), and uses i to enumerate through all of the matches m of type match_results< BidiIter > that occur within the sequence [begin, end). If no such matches are found and !(flags & format_no_copy) then calls std::copy(begin, end, out). Otherwise, for each match found, if !(flags & format_no_copy) calls std::copy(m.prefix().first, m.prefix().second, out), and then calls m.format(out, format, flags). Finally if !(flags & format_no_copy) calls std::copy(last_m.suffix().first, last_m.suffix().second, out) where last_m is a copy of the last match found.If flags & format_first_only is non-zero then only the first match found is replaced. Type BidiIter meets the requirements of a Bidirectional Iterator (24.1.4). Type OutIter meets the requirements of an Output Iterator (24.1.2). Type Formatter models ForwardRange, Callable<match_results<BidiIter> >, Callable<match_results<BidiIter>, OutIter>, or Callable<match_results<BidiIter>, OutIter, regex_constants::match_flag_type>; or else it is a null-terminated format string, or an expression template representing a formatter lambda expression. [begin,end) denotes a valid iterator range. The value of the output iterator after the output sequence has been written to it. regex_error on stack exhaustion or invalid format string.
Contains the definition of regex_compiler, a factory for building regex objects from strings.
Contains definitions for the syntax_option_type, match_flag_type and error_type enumerations. = 0Specifies that the grammar recognized by the regular expression engine uses its normal semantics: that is the same as that given in the ECMA-262, ECMAScript Language Specification, Chapter 15 part 10, RegExp (Regular Expression) Objects (FWD.1). = 1 << 1Specifies that matching of regular expressions against a character container sequence shall be performed without regard to case. = 1 << 2Specifies that when a regular expression is matched against a character container sequence, then no sub-expression matches are to be stored in the supplied match_results structure. = 1 << 3Specifies that the regular expression engine should pay more attention to the speed with which regular expressions are matched, and less to the speed with which regular expression objects are constructed. Otherwise it has no detectable effect on the program output. = 1 << 4Specifies that character ranges of the form "[a-b]" should be locale sensitive. = 1 << 10Specifies that the ^ and $ metacharacters DO NOT match at internal line breaks. Note that this is the opposite of the perl default. It is the inverse of perl's /m (multi-line) modifier. = 1 << 11Specifies that the . metacharacter does not match the null character \0. = 1 << 12Specifies that the . metacharacter does not match the newline character \n. = 1 << 13Specifies that non-escaped white-space is not significant. Flags used to customize the regex syntax = 0Specifies 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) = 1 << 1Specifies that the expression "^" should not be matched against the sub-sequence [first,first). = 1 << 2Specifies that the expression "\$" should not be matched against the sub-sequence [last,last). = 1 << 3Specifies that the expression "\\b" should not be matched against the sub-sequence [first,first). = 1 << 4Specifies that the expression "\\b" should not be matched against the sub-sequence [last,last). = 1 << 7Specifies that if more than one match is possible then any match is an acceptable result. = 1 << 8Specifies that the expression can not be matched against an empty sequence. = 1 << 10Specifies that the expression must match a sub-sequence that begins at first. = 1 << 11Specifies 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. = 1 << 12Specifies that –first is a valid iterator position, when this flag is set then the flags match_not_bol and match_not_bow are ignored by the regular expression algorithms (RE.7) and iterators (RE.8). = 0Specifies 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. = 1 << 13Specifies 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. = 1 << 14Specifies 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). = 1 << 15When 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. = 1 << 16When specified during a search and replace operation, then only the first occurrence of the regular expression is replaced. = 1 << 17Treat the format string as a literal. = 1 << 18Specifies that all syntax extensions are enabled, including conditional (?ddexpression1:expression2) replacements. Flags used to customize the behavior of the regex algorithms The expression contained an invalid collating element name. The expression contained an invalid character class name. The expression contained an invalid escaped character, or a trailing escape. The expression contained an invalid back-reference. The expression contained mismatched [ and ]. The expression contained mismatched ( and ). The expression contained mismatched { and }. The expression contained an invalid range in a {} expression. The expression contained an invalid character range, for example [b-a]. There was insufficient memory to convert the expression into a finite state machine. One of *?+{ was not preceded by a valid regular expression. The complexity of an attempted match against a regular expression exceeded a pre-set level. There was insufficient memory to determine whether the regular expression could match the specified character sequence. An nested regex is uninitialized. An invalid use of a named capture. An attempt to create a variable-width look-behind assertion was detected. An invalid use of a rule was detected. An argument to an action was unbound. Tried to read from an uninitialized attribute. An internal error has occurred. Error codes used by the regex_error type
Contains the definition of the regex_error exception class. std::runtime_errorexceptionThe class regex_error defines the type of objects thrown as exceptions to report errors during the conversion from a string representing a regular expression to a finite state machine. regex_constants::error_typeAccessor for the error_type value the error_type code passed to the constructor Will not throw. regex_constants::error_typeThe error_type this regex_error represents. char const *""The message string of this regex_error. Constructs an object of class regex_error. code() == code Destructor for class regex_error Will not throw.
Contains the definition of the regex_iterator type, an STL-compatible iterator for stepping through all the matches in a sequence.
Contains the syntax elements for writing static regular expressions. Sub-match placeholder type, used to create named captures in static regexes. mark_tag is the type of the global sub-match placeholders s0, s1, etc.. You can use the mark_tag type to create your own sub-match placeholders with more meaningful names. This is roughly equivalent to the "named capture" feature of dynamic regular expressions.To create a named sub-match placeholder, initialize it with a unique integer. The integer must only be unique within the regex in which the placeholder is used. Then you can use it within static regexes to created sub-matches by assigning a sub-expression to it, or to refer back to already created sub-matches.mark_tag number(1); // "number" is now equivalent to "s1" // Match a number, followed by a space and the same number again sregex rx = (number = +_d) >> ' ' >> number; After a successful regex_match() or regex_search(), the sub-match placeholder can be used to index into the match_results<> object to retrieve the corresponding sub-match. unspecifiedint intAn integer that uniquely identifies this mark_tag within the static regexes in which this mark_tag will be used. Initialize a mark_tag placeholder. mark_nbr > 0 unsigned int constFor infinite repetition of a sub-expression. Magic value used with the repeat<>() function template to specify an unbounded repeat. Use as: repeat<17, inf>('a'). The equivalent in perl is /a{17,}/. unspecifiedSuccessfully matches nothing. Successfully matches a zero-width sequence. nil always succeeds and never consumes any characters. unspecifiedMatches an alpha-numeric character. The regex traits are used to determine which characters are alpha-numeric. To match any character that is not alpha-numeric, use ~alnum.alnum is equivalent to /[[:alnum:]]/ in perl. ~alnum is equivalent to /[[:^alnum:]]/ in perl. unspecifiedMatches an alphabetic character. The regex traits are used to determine which characters are alphabetic. To match any character that is not alphabetic, use ~alpha.alpha is equivalent to /[[:alpha:]]/ in perl. ~alpha is equivalent to /[[:^alpha:]]/ in perl. unspecifiedMatches a blank (horizonal white-space) character. The regex traits are used to determine which characters are blank characters. To match any character that is not blank, use ~blank.blank is equivalent to /[[:blank:]]/ in perl. ~blank is equivalent to /[[:^blank:]]/ in perl. unspecifiedMatches a control character. The regex traits are used to determine which characters are control characters. To match any character that is not a control character, use ~cntrl.cntrl is equivalent to /[[:cntrl:]]/ in perl. ~cntrl is equivalent to /[[:^cntrl:]]/ in perl. unspecifiedMatches a digit character. The regex traits are used to determine which characters are digits. To match any character that is not a digit, use ~digit.digit is equivalent to /[[:digit:]]/ in perl. ~digit is equivalent to /[[:^digit:]]/ in perl. unspecifiedMatches a graph character. The regex traits are used to determine which characters are graphable. To match any character that is not graphable, use ~graph.graph is equivalent to /[[:graph:]]/ in perl. ~graph is equivalent to /[[:^graph:]]/ in perl. unspecifiedMatches a lower-case character. The regex traits are used to determine which characters are lower-case. To match any character that is not a lower-case character, use ~lower.lower is equivalent to /[[:lower:]]/ in perl. ~lower is equivalent to /[[:^lower:]]/ in perl. unspecifiedMatches a printable character. The regex traits are used to determine which characters are printable. To match any character that is not printable, use ~print.print is equivalent to /[[:print:]]/ in perl. ~print is equivalent to /[[:^print:]]/ in perl. unspecifiedMatches a punctuation character. The regex traits are used to determine which characters are punctuation. To match any character that is not punctuation, use ~punct.punct is equivalent to /[[:punct:]]/ in perl. ~punct is equivalent to /[[:^punct:]]/ in perl. unspecifiedMatches a space character. The regex traits are used to determine which characters are space characters. To match any character that is not white-space, use ~space.space is equivalent to /[[:space:]]/ in perl. ~space is equivalent to /[[:^space:]]/ in perl. unspecifiedMatches an upper-case character. The regex traits are used to determine which characters are upper-case. To match any character that is not upper-case, use ~upper.upper is equivalent to /[[:upper:]]/ in perl. ~upper is equivalent to /[[:^upper:]]/ in perl. unspecifiedMatches a hexadecimal digit character. The regex traits are used to determine which characters are hex digits. To match any character that is not a hex digit, use ~xdigit.xdigit is equivalent to /[[:xdigit:]]/ in perl. ~xdigit is equivalent to /[[:^xdigit:]]/ in perl. unspecifiedBeginning of sequence assertion. For the character sequence [begin, end), 'bos' matches the zero-width sub-sequence [begin, begin). unspecifiedEnd of sequence assertion. For the character sequence [begin, end), 'eos' matches the zero-width sub-sequence [end, end).Unlike the perl end of sequence assertion $, 'eos' will not match at the position [end-1, end-1) if *(end-1) is '\n'. To get that behavior, use (!_n >> eos). unspecifiedBeginning of line assertion. 'bol' matches the zero-width sub-sequence immediately following a logical newline sequence. The regex traits is used to determine what constitutes a logical newline sequence. unspecifiedEnd of line assertion. 'eol' matches the zero-width sub-sequence immediately preceeding a logical newline sequence. The regex traits is used to determine what constitutes a logical newline sequence. unspecifiedBeginning of word assertion. 'bow' matches the zero-width sub-sequence immediately following a non-word character and preceeding a word character. The regex traits are used to determine what constitutes a word character. unspecifiedEnd of word assertion. 'eow' matches the zero-width sub-sequence immediately following a word character and preceeding a non-word character. The regex traits are used to determine what constitutes a word character. unspecifiedWord boundary assertion. '_b' matches the zero-width sub-sequence at the beginning or the end of a word. It is equivalent to (bow | eow). The regex traits are used to determine what constitutes a word character. To match a non-word boundary, use ~_b._b is like \b in perl. ~_b is like \B in perl. unspecifiedMatches a word character. '_w' matches a single word character. The regex traits are used to determine which characters are word characters. Use ~_w to match a character that is not a word character._w is like \w in perl. ~_w is like \W in perl. unspecifiedMatches a digit character. '_d' matches a single digit character. The regex traits are used to determine which characters are digits. Use ~_d to match a character that is not a digit character._d is like \d in perl. ~_d is like \D in perl. unspecifiedMatches a space character. '_s' matches a single space character. The regex traits are used to determine which characters are space characters. Use ~_s to match a character that is not a space character._s is like \s in perl. ~_s is like \S in perl. proto::terminal< char >::type constMatches a literal newline character, '\n'. '_n' matches a single newline character, '\n'. Use ~_n to match a character that is not a newline.~_n is like '.' in perl without the /s modifier. unspecifiedMatches a logical newline sequence. '_ln' matches a logical newline sequence. This can be any character in the line separator class, as determined by the regex traits, or the '\r\n' sequence. For the purpose of back-tracking, '\r\n' is treated as a unit. To match any one character that is not a logical newline, use ~_ln. unspecifiedMatches any one character. Match any character, similar to '.' in perl syntax with the /s modifier. '_' matches any one character, including the newline.To match any character except the newline, use ~_n unspecifiedReference to the current regex object. Useful when constructing recursive regular expression objects. The 'self' identifier is a short-hand for the current regex object. For instance, sregex rx = '(' >> (self | nil) >> ')'; will create a regex object that matches balanced parens such as "((()))". unspecifiedUsed to create character sets. There are two ways to create character sets with the 'set' identifier. The easiest is to create a comma-separated list of the characters in the set, as in (set= 'a','b','c'). This set will match 'a', 'b', or 'c'. The other way is to define the set as an argument to the set subscript operator. For instance, set[ 'a' | range('b','c') | digit ] will match an 'a', 'b', 'c' or a digit character.To complement a set, apply the '~' operator. For instance, ~(set= 'a','b','c') will match any character that is not an 'a', 'b', or 'c'.Sets can be composed of other, possibly complemented, sets. For instance, set[ ~digit | ~(set= 'a','b','c') ]. mark_tag constSub-match placeholder, like $& in Perl. mark_tag constSub-match placeholder, like $1 in perl. To create a sub-match, assign a sub-expression to the sub-match placeholder. For instance, (s1= _) will match any one character and remember which character was matched in the 1st sub-match. Later in the pattern, you can refer back to the sub-match. For instance, (s1= _) >> s1 will match any character, and then match the same character again.After a successful regex_match() or regex_search(), the sub-match placeholders can be used to index into the match_results<> object to retrieve the Nth sub-match. mark_tag const mark_tag const mark_tag const mark_tag const mark_tag const mark_tag const mark_tag const mark_tag const unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecified unspecifiedExpr const &Makes a sub-expression case-insensitive. Use icase() to make a sub-expression case-insensitive. For instance, "foo" >> icase(set['b'] >> "ar") will match "foo" exactly followed by "bar" irrespective of case. unspecifiedLiteral const &Makes a literal into a regular expression. Use as_xpr() to turn a literal into a regular expression. For instance, "foo" >> "bar" will not compile because both operands to the right-shift operator are const char*, and no such operator exists. Use as_xpr("foo") >> "bar" instead.You can use as_xpr() with character literals in addition to string literals. For instance, as_xpr('a') will match an 'a'. You can also complement a character literal, as with ~as_xpr('a'). This will match any one character that is not an 'a'. proto::terminal< reference_wrapper< basic_regex< BidiIter > const > >::type constbasic_regex< BidiIter > const &The basic_regex object to embed by reference. Embed a regex object by reference. unspecifiedCharThe lower end of the range to match. CharThe upper end of the range to match. Match a range of characters. Match any character in the range [ch_min, ch_max]. proto::result_of::make_expr< proto::tag::logical_not, proto::default_domain, Expr const & >::type constExpr const &The sub-expression to make optional. Make a sub-expression optional. Equivalent to !as_xpr(expr). unspecifiedExpr const &The sub-expression to repeat. unspecifiedExpr2 const &Repeat a sub-expression multiple times. There are two forms of the repeat<>() function template. To match a sub-expression N times, use repeat<N>(expr). To match a sub-expression from M to N times, use repeat<M,N>(expr).The repeat<>() function creates a greedy quantifier. To make the quantifier non-greedy, apply the unary minus operator, as in -repeat<M,N>(expr). unspecifiedExpr const &The sub-expression to modify. Create an independent sub-expression. 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.keep(expr) is equivalent to the perl (?>...) extension. unspecifiedExpr const &The sub-expression to put in the look-ahead assertion. Look-ahead assertion. before(expr) succeeds if the expr sub-expression would match at the current position in the sequence, but expr is not included in the match. For instance, before("foo") succeeds if we are before a "foo". Look-ahead assertions can be negated with the bit-compliment operator.before(expr) is equivalent to the perl (?=...) extension. ~before(expr) is a negative look-ahead assertion, equivalent to the perl (?!...) extension. unspecifiedExpr const &The sub-expression to put in the look-ahead assertion.Look-behind assertion. after(expr) succeeds if the expr sub-expression would match at the current position minus N in the sequence, where N is the width of expr. expr is not included in the match. For instance, after("foo") succeeds if we are after a "foo". Look-behind assertions can be negated with the bit-complement operator.after(expr) is equivalent to the perl (?<=...) extension. ~after(expr) is a negative look-behind assertion, equivalent to the perl (?<!...) extension. expr cannot match a variable number of characters. unspecifiedLocale const &The std::locale or regex traits object. Specify a regex traits or a std::locale. imbue() instructs the regex engine to use the specified traits or locale when matching the regex. The entire expression must use the same traits/locale. For instance, the following specifies a locale for use with a regex: std::locale loc; sregex rx = imbue(loc)(+digit); unspecifiedSkip const &A regex that specifies which characters to skip. Specify which characters to skip when matching a regex. skip() instructs the regex engine to skip certain characters when matching a regex. It is most useful for writing regexes that ignore whitespace. For instance, the following specifies a regex that skips whitespace and punctuation:// A sentence is one or more words separated by whitespace // and punctuation. sregex word = +alpha; sregex sentence = skip(set[_s | punct])( +word ); The way it works in the above example is to insert keep(*set[_s | punct]) before each primitive within the regex. A "primitive" includes terminals like strings, character sets and nested regexes. A final *set[_s | punct] is added to the end of the regex. The regex sentence specified above is equivalent to the following:sregex sentence = +( keep(*set[_s | punct]) >> word ) >> *set[_s | punct]; Skipping does not affect how nested regexes are handled because they are treated atomically. String literals are also treated atomically; that is, no skipping is done within a string literal. So skip(_s)("this that") is not the same as skip(_s)("this" >> as_xpr("that")). The first will only match when there is only one space between "this" and "that". The second will skip any and all whitespace between "this" and "that".
Contains the definition of regex_token_iterator, and STL-compatible iterator for tokenizing a string using a regular expression.
Includes the C regex traits or the CPP regex traits header file depending on the BOOST_XPRESSIVE_USE_C_TRAITS macro. Tag used to denote that a traits class conforms to the version 1 traits interface. boost::xpressive::regex_traits_version_1_tagTag used to denote that a traits class conforms to the version 2 traits interface.
Contains the definition of the class template sub_match<> and associated helper functions BidiItersub_match< BidiIter > &the sub_match<> object denoting the range BidiItersub_match< BidiIter > const &range_begin() to make sub_match<> a valid range sub.first is not singular sub.first BidiItersub_match< BidiIter > &the sub_match<> object denoting the range BidiItersub_match< BidiIter > const &range_end() to make sub_match<> a valid range sub.second is not singular sub.second std::basic_ostream< Char, Traits > &std::basic_ostream< Char, Traits > &output stream. sub_match< BidiIter > const &sub_match object to be written to the stream. insertion operator for sending sub-matches to ostreams sout << sub.str() boolsub_match< BidiIter > const &sub_match< BidiIter > const & boolsub_match< BidiIter > const &sub_match< BidiIter > const & boolsub_match< BidiIter > const &sub_match< BidiIter > const & boolsub_match< BidiIter > const &sub_match< BidiIter > const & boolsub_match< BidiIter > const &sub_match< BidiIter > const & boolsub_match< BidiIter > const &sub_match< BidiIter > const & booltypename iterator_value< BidiIter >::type const *sub_match< BidiIter > const & booltypename iterator_value< BidiIter >::type const *sub_match< BidiIter > const & booltypename iterator_value< BidiIter >::type const *sub_match< BidiIter > const & booltypename iterator_value< BidiIter >::type const *sub_match< BidiIter > const & booltypename iterator_value< BidiIter >::type const *sub_match< BidiIter > const & booltypename iterator_value< BidiIter >::type const *sub_match< BidiIter > const & boolsub_match< BidiIter > const &typename iterator_value< BidiIter >::type const * boolsub_match< BidiIter > const &typename iterator_value< BidiIter >::type const * boolsub_match< BidiIter > const &typename iterator_value< BidiIter >::type const * boolsub_match< BidiIter > const &typename iterator_value< BidiIter >::type const * boolsub_match< BidiIter > const &typename iterator_value< BidiIter >::type const * boolsub_match< BidiIter > const &typename iterator_value< BidiIter >::type const * booltypename iterator_value< BidiIter >::type const &sub_match< BidiIter > const & booltypename iterator_value< BidiIter >::type const &sub_match< BidiIter > const & booltypename iterator_value< BidiIter >::type const &sub_match< BidiIter > const & booltypename iterator_value< BidiIter >::type const &sub_match< BidiIter > const & booltypename iterator_value< BidiIter >::type const &sub_match< BidiIter > const & booltypename iterator_value< BidiIter >::type const &sub_match< BidiIter > const & boolsub_match< BidiIter > const &typename iterator_value< BidiIter >::type const & boolsub_match< BidiIter > const &typename iterator_value< BidiIter >::type const & boolsub_match< BidiIter > const &typename iterator_value< BidiIter >::type const & boolsub_match< BidiIter > const &typename iterator_value< BidiIter >::type const & boolsub_match< BidiIter > const &typename iterator_value< BidiIter >::type const & boolsub_match< BidiIter > const &typename iterator_value< BidiIter >::type const & sub_match< BidiIter >::string_typesub_match< BidiIter > const &sub_match< BidiIter > const & sub_match< BidiIter >::string_typesub_match< BidiIter > const &typename iterator_value< BidiIter >::type const & sub_match< BidiIter >::string_typetypename iterator_value< BidiIter >::type const &sub_match< BidiIter > const & sub_match< BidiIter >::string_typesub_match< BidiIter > const &typename iterator_value< BidiIter >::type const * sub_match< BidiIter >::string_typetypename iterator_value< BidiIter >::type const *sub_match< BidiIter > const & sub_match< BidiIter >::string_typesub_match< BidiIter > const &typename sub_match< BidiIter >::string_type const & sub_match< BidiIter >::string_typetypename sub_match< BidiIter >::string_type const &sub_match< BidiIter > const &
Contains the definition of the c_regex_traits<> template, which is a wrapper for the C locale functions that can be used to customize the behavior of static and dynamic regexes. c_regex_traits< char >true_
Contains the definition of the cpp_regex_traits<> template, which is a wrapper for std::locale that can be used to customize the behavior of static and dynamic regexes. cpp_regex_traits< char >true_
Contains the definition of the null_regex_traits<> template, which is a stub regex traits implementation that can be used by static and dynamic regexes for searching non-character data.
Includes all of xpressive including support for both static and dynamic regular expressions.
Includes everything you need to write and use dynamic regular expressions.
Forward declarations for all of xpressive's public data types. Class template basic_regex<> is a class for holding a compiled regular expression. std::size_tReturns the count of capturing sub-expressions in this regular expression regex_id_typeReturns a token which uniquely identifies this regular expression. voidbasic_regex< BidiIter > &The other basic_regex object. Swaps the contents of this basic_regex object with another. This is a shallow swap that does not do reference tracking. If you embed a basic_regex object by reference in another regular expression and then swap its contents with another basic_regex object, the change will not be visible to the enclosing regular expression. It is done this way to ensure that swap() cannot throw. Will not throw. regex_id() == 0 mark_count() == 0 basic_regex< BidiIter > const &The basic_regex object to copy. regex_id() == that.regex_id() mark_count() == that.mark_count() basic_regex< BidiIter > &basic_regex< BidiIter > const &The basic_regex object to copy. regex_id() == that.regex_id() mark_count() == that.mark_count() *this Expr const &The static regular expression Construct from a static regular expression. Expr is the type of a static regular expression. regex_id() != 0 mark_count() >= 0 basic_regex< BidiIter > &Expr const &The static regular expression. Construct from a static regular expression. Expr is the type of a static regular expression. regex_id() != 0 mark_count() >= 0 *this std::bad_alloc on out of memory basic_regex< BidiIter >InputIterThe beginning of a range of characters representing the regular expression to compile. InputIterThe end of a range of characters representing the regular expression to compile. flag_typeregex_constants::ECMAScriptOptional bitmask that determines how the pat string is interpreted. (See syntax_option_type.) Factory method for building a regex object from a range of characters. Equivalent to regex_compiler< BidiIter >().compile(begin, end, flags); [begin,end) is a valid range. The range of characters specified by [begin,end) contains a valid string-based representation of a regular expression. A basic_regex object corresponding to the regular expression represented by the character range. regex_error when the range of characters has invalid regular expression syntax. basic_regex< BidiIter >InputRange const &flag_typeregex_constants::ECMAScriptThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. basic_regex< BidiIter >char_type const *flag_typeregex_constants::ECMAScriptThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. basic_regex< BidiIter >char_type const *std::size_tflag_typeThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Encapsaulates the standard C locale functions for use by the basic_regex<> class template. boolc_regex_traits< char_type > const &Checks two c_regex_traits objects for equality true. boolc_regex_traits< char_type > const &Checks two c_regex_traits objects for inequality false. string_typechar_typeThe source character. Returns a string_type containing all the characters that compare equal disregrarding case to the one passed in. This function can only be called if has_fold_case<c_regex_traits<Char> >::value is true. string_type containing all chars which are equal to ch when disregarding case locale_typelocale_typeNo-op locale_type const &locale_type()Initialize a c_regex_traits object to use the global C locale. char_typecharThe source character. Convert a char to a Char ch if Char is char, std::btowc(ch) if Char is wchar_t. unsigned charchar_typeThe source character. Returns a hash value for a Char in the range [0, UCHAR_MAX] a value between 0 and UCHAR_MAX, inclusive. char_typechar_typeThe source character. No-op ch char_typechar_typeThe source character. Converts a character to lower-case using the current global C locale. std::tolower(ch) if Char is char, std::towlower(ch) if Char is wchar_t. char_typechar_typeThe source character. Converts a character to lower-case using the current global C locale. std::tolower(ch) if Char is char, std::towlower(ch) if Char is wchar_t. char_typechar_typeThe source character. Converts a character to upper-case using the current global C locale. std::toupper(ch) if Char is char, std::towupper(ch) if Char is wchar_t. boolchar_typeThe bottom of the range, inclusive. char_typeThe top of the range, inclusive. char_typeThe source character. Checks to see if a character is within a character range. first <= ch && ch <= last. boolchar_typeThe bottom of the range, inclusive. char_typeThe top of the range, inclusive. char_typeThe source character. Checks to see if a character is within a character range, irregardless of case. The default implementation doesn't do proper Unicode case folding, but this is the best we can do with the standard C locale functions. in_range(first, last, ch) || in_range(first, last, tolower(ch)) || in_range(first, last, toupper(ch)) string_typeFwdIterFwdIterReturns a sort key for the character sequence designated by the iterator range [F1, F2) such that if the character sequence [G1, G2) sorts before the character sequence [H1, H2) then v.transform(G1, G2) < v.transform(H1, H2).Not currently used string_typeFwdIterFwdIterReturns a sort key for the character sequence designated by the iterator range [F1, F2) such that if the character sequence [G1, G2) sorts before the character sequence [H1, H2) when character case is not considered then v.transform_primary(G1, G2) < v.transform_primary(H1, H2).Not currently used string_typeFwdIterFwdIterReturns a sequence of characters that represents the collating element consisting of the character sequence designated by the iterator range [F1, F2). Returns an empty string if the character sequence is not a valid collating element.Not currently used char_class_typeFwdIterA forward iterator to the start of the character sequence representing the name of the character class. FwdIterThe end of the character sequence. boolSpecifies whether the returned bitmask should represent the case-insensitive version of the character class. For the character class name represented by the specified character sequence, return the corresponding bitmask representation. A bitmask representing the character class. boolchar_typeThe character to test. char_class_typeThe character class bitmask against which to test. Tests a character against a character class bitmask. mask is a bitmask returned by lookup_classname, or is several such masks bit-or'ed together. true if the character is a member of any of the specified character classes, false otherwise. intchar_typeThe digit character. intThe radix to use for the conversion. Convert a digit character into the integer it represents. radix is one of 8, 10, or 16. -1 if ch is not a digit character, the integer value of the character otherwise. If char_type is char, std::strtol is used for the conversion. If char_type is wchar_t, std::wcstol is used. locale_typeNo-op Encapsaulates a std::locale for use by the basic_regex<> class template. boolcpp_regex_traits< char_type > const &Checks two cpp_regex_traits objects for equality this->getloc() == that.getloc(). boolcpp_regex_traits< char_type > const &Checks two cpp_regex_traits objects for inequality this->getloc() != that.getloc(). char_typecharThe source character. Convert a char to a Char std::use_facet<std::ctype<char_type> >(this->getloc()).widen(ch). char_typechar_typeThe source character. Converts a character to lower-case using the internally-stored std::locale. std::tolower(ch, this->getloc()). char_typechar_typeThe source character. Converts a character to lower-case using the internally-stored std::locale. std::tolower(ch, this->getloc()). char_typechar_typeThe source character. Converts a character to upper-case using the internally-stored std::locale. std::toupper(ch, this->getloc()). string_typechar_typeThe source character. Returns a string_type containing all the characters that compare equal disregrarding case to the one passed in. This function can only be called if has_fold_case<cpp_regex_traits<Char> >::value is true. string_type containing all chars which are equal to ch when disregarding case boolchar_typeThe bottom of the range, inclusive. char_typeThe top of the range, inclusive. char_typeThe source character. Checks to see if a character is within a character range, irregardless of case. The default implementation doesn't do proper Unicode case folding, but this is the best we can do with the standard ctype facet. in_range(first, last, ch) || in_range(first, last, tolower(ch, this->getloc())) || in_range(first, last, toupper(ch, this->getloc())) string_typeFwdIterFwdIterReturns a sort key for the character sequence designated by the iterator range [F1, F2) such that if the character sequence [G1, G2) sorts before the character sequence [H1, H2) when character case is not considered then v.transform_primary(G1, G2) < v.transform_primary(H1, H2).Not currently used string_typeFwdIterFwdIterReturns a sequence of characters that represents the collating element consisting of the character sequence designated by the iterator range [F1, F2). Returns an empty string if the character sequence is not a valid collating element.Not currently used char_class_typeFwdIterA forward iterator to the start of the character sequence representing the name of the character class. FwdIterThe end of the character sequence. boolSpecifies whether the returned bitmask should represent the case-insensitive version of the character class. For the character class name represented by the specified character sequence, return the corresponding bitmask representation. A bitmask representing the character class. boolchar_typeThe character to test. char_class_typeThe character class bitmask against which to test. Tests a character against a character class bitmask. mask is a bitmask returned by lookup_classname, or is several such masks bit-or'ed together. true if the character is a member of any of the specified character classes, false otherwise. intchar_typeThe digit character. intThe radix to use for the conversion. Convert a digit character into the integer it represents. radix is one of 8, 10, or 16. -1 if ch is not a digit character, the integer value of the character otherwise. The conversion is performed by imbueing a std::stringstream with this->getloc(); setting the radix to one of oct, hex or dec; inserting ch into the stream; and extracting an int. locale_typelocale_typeA std::locale. Imbues *this with loc the previous std::locale used by *this. locale_typeReturns the current std::locale used by *this. unsigned charunsigned char unsigned charchar unsigned charsigned char unsigned charwchar_t locale_type const &locale_type()Initialize a cpp_regex_traits object to use the specified std::locale, or the global std::locale if none is specified. unsigned charchar_typeThe source character. Returns a hash value for a Char in the range [0, UCHAR_MAX] a value between 0 and UCHAR_MAX, inclusive. char_typechar_typeThe source character. No-op ch boolchar_typeThe bottom of the range, inclusive. char_typeThe top of the range, inclusive. char_typeThe source character. Checks to see if a character is within a character range. first <= ch && ch <= last. is_convertible< Traits::version_tag *, regex_traits_version_1_case_fold_tag * >Trait used to denote that a traits class has the fold_case member function. proto::terminal::type< reference_wrapper< T > >local<> is a lazy wrapper for a reference to a value that is stored within the local itself. It is for use within xpressive semantic actions. Below is an example of how to use local<> in semantic actions.using namespace boost::xpressive; local<int> i(0); std::string str("1!2!3?"); // count the exciting digits, but not the // questionable ones. sregex rex = +( _d [ ++i ] >> '!' ); regex_search(str, rex); assert( i.get() == 2 ); As the name "local" suggests, local<> objects and the regexes that refer to them should never leave the local scope. The value stored within the local object will be destroyed at the end of the local<>'s lifetime, and any regex objects still holding the local<> will be left with a dangling reference. T &Fetch the wrapped value. T const &This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Store a default-constructed value of type T. T const &The initial value. Store a default-constructed value of type T. Class template match_results<> holds the results of a regex_match() or a regex_search() as a collection of sub_match objects. Class template match_results<> denotes a collection of sequences representing the result of a regular expression match. Storage for the collection is allocated and freed as necessary by the member functions of class match_results<>.The class template 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. size_typeReturns one plus the number of marked sub-expressions in the regular expression that was matched if *this represents the result of a successful match. Otherwise returns 0. boolReturns size() == 0. difference_typesize_type0Returns (*this)[sub].length(). difference_typesize_type0If !(*this)[sub].matched then returns -1. Otherwise returns std::distance(base, (*this)[sub].first), where base is the start iterator of the sequence that was searched. [Note - unless this is part of a repeated search with a regex_iterator then base is the same as prefix().first - end note] string_typesize_type0Returns (*this)[sub].str(). const_referenceSub const &Returns a reference to the sub_match object representing the sequence that matched marked sub-expression sub. If sub == 0 then returns a reference to a sub_match object representing the sequence that matched the whole regular expression. If sub >= size() then returns a sub_match object representing an unmatched sub-expression. const_referenceReturns a reference to the sub_match object representing the character sequence from the start of the string being matched/searched, to the start of the match found. (*this)[0].matched is true const_referenceReturns a reference to the sub_match object representing the character sequence from the end of the match found to the end of the string being matched/searched. (*this)[0].matched is true const_iteratorReturns a starting iterator that enumerates over all the marked sub-expression matches stored in *this. const_iteratorReturns a terminating iterator that enumerates over all the marked sub-expression matches stored in *this. bool_typeReturns a true value if (*this)[0].matched, else returns a false value. boolReturns true if empty() || !(*this)[0].matched, else returns false. regex_id_typeReturns the id of the basic_regex object most recently used with this match_results object. nested_results_type const &Returns a Sequence of nested match_results elements. OutputIteratorOutputIteratorFormat const &regex_constants::match_flag_typeregex_constants::format_defaultunspecified0If Format models ForwardRange or is a null-terminated string, this function copies the character sequence in fmt to OutputIterator out. For each format specifier or escape sequence in fmt, replace that sequence with either the character(s) it represents, or the sequence within *this to which it refers. The bitmasks specified in flags determines what format specifiers or escape sequences are recognized. By default, this is the format used by ECMA-262, ECMAScript Language Specification, Chapter 15 part 5.4.11 String.prototype.replace.Otherwise, if Format models Callable<match_results<BidiIter>, OutputIterator, regex_constants::match_flag_type>, this function returns fmt(*this, out, flags).Otherwise, if Format models Callable<match_results<BidiIter>, OutputIterator>, this function returns fmt(*this, out).Otherwise, if Format models Callable<match_results<BidiIter> >, this function returns std::copy(x.begin(), x.end(), out), where x is the result of calling fmt(*this). OutputIteratorOutputIteratorchar_type const *regex_constants::match_flag_typeregex_constants::format_defaultThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. string_typeFormat const &regex_constants::match_flag_typeregex_constants::format_defaultunspecified0If Format models ForwardRange or is a null-terminated string, this function returns a copy of the character sequence fmt. For each format specifier or escape sequence in fmt, replace that sequence with either the character(s) it represents, or the sequence within *this to which it refers. The bitmasks specified in flags determines what format specifiers or escape sequences are recognized. By default this is the format used by ECMA-262, ECMAScript Language Specification, Chapter 15 part 5.4.11 String.prototype.replace.Otherwise, if Format models Callable<match_results<BidiIter>, OutputIterator, regex_constants::match_flag_type>, this function returns a string_type object x populated by calling fmt(*this, out, flags), where out is a back_insert_iterator into x.Otherwise, if Format models Callable<match_results<BidiIter>, OutputIterator>, this function returns a string_type object x populated by calling fmt(*this, out), where out is a back_insert_iterator into x.Otherwise, if Format models Callable<match_results<BidiIter> >, this function returns fmt(*this). string_typechar_type const *regex_constants::match_flag_typeregex_constants::format_defaultThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. voidmatch_results< BidiIter > &The match_results object to swap with. Swaps the contents of two match_results objects. Guaranteed not to throw. *this contains the sequence of matched sub-expressions that were in that, that contains the sequence of matched sub-expressions that were in *this. Will not throw. match_results< BidiIter > &Arg const &TODO document me regex_id() == 0 size() == 0 empty() == true str() == string_type() match_results< BidiIter > const &The match_results object to copy regex_id() == that.regex_id(). size() == that.size(). empty() == that.empty(). str(n) == that.str(n) for all positive integers n < that.size(). prefix() == that.prefix(). suffix() == that.suffix(). (*this)[n] == that[n] for all positive integers n < that.size(). length(n) == that.length(n) for all positive integers n < that.size(). position(n) == that.position(n) for all positive integers n < that.size(). match_results< BidiIter > &match_results< BidiIter > const &The match_results object to copy. regex_id() == that.regex_id(). size() == that.size(). empty() == that.empty(). str(n) == that.str(n) for all positive integers n < that.size(). prefix() == that.prefix(). suffix() == that.suffix(). (*this)[n] == that[n] for all positive integers n < that.size(). length(n) == that.length(n) for all positive integers n < that.size(). position(n) == that.position(n) for all positive integers n < that.size(). stub regex_traits for non-char data boolnull_regex_traits< char_type > const &Checks two null_regex_traits objects for equality true. boolnull_regex_traits< char_type > const &Checks two null_regex_traits objects for inequality false. char_typecharThe source character. Convert a char to a Elem Elem(ch). locale_typelocale_type()Initialize a null_regex_traits object. unsigned charchar_typeThe source character. Returns a hash value for a Elem in the range [0, UCHAR_MAX] a value between 0 and UCHAR_MAX, inclusive. char_typechar_typeThe source character. No-op ch char_typechar_typeThe source character. No-op ch boolchar_typeThe bottom of the range, inclusive. char_typeThe top of the range, inclusive. char_typeThe source character. Checks to see if a character is within a character range. first <= ch && ch <= last. boolchar_typeThe bottom of the range, inclusive. char_typeThe top of the range, inclusive. char_typeThe source character. Checks to see if a character is within a character range. Since the null_regex_traits does not do case-folding, this function is equivalent to in_range(). first <= ch && ch <= last. string_typeFwdIterFwdIterReturns a sort key for the character sequence designated by the iterator range [F1, F2) such that if the character sequence [G1, G2) sorts before the character sequence [H1, H2) then v.transform(G1, G2) < v.transform(H1, H2).Not currently used string_typeFwdIterFwdIterReturns a sort key for the character sequence designated by the iterator range [F1, F2) such that if the character sequence [G1, G2) sorts before the character sequence [H1, H2) when character case is not considered then v.transform_primary(G1, G2) < v.transform_primary(H1, H2).Not currently used string_typeFwdIterFwdIterReturns a sequence of characters that represents the collating element consisting of the character sequence designated by the iterator range [F1, F2). Returns an empty string if the character sequence is not a valid collating element.Not currently used char_class_typeFwdIternot used FwdIternot used boolnot used The null_regex_traits does not have character classifications, so lookup_classname() is unused. static_cast<char_class_type>(0) boolchar_typenot used char_class_typenot used The null_regex_traits does not have character classifications, so isctype() is unused. false intchar_typenot used intnot used The null_regex_traits recognizes no elements as digits, so value() is unused. -1 locale_typelocale_typenot used Not used loc locale_typeReturns locale_type(). locale_type() For defining a placeholder to stand in for a variable a semantic action. Use placeholder<> to define a placeholder for use in semantic actions to stand in for real objects. The use of placeholders allows regular expressions with actions to be defined once and reused in many contexts to read and write from objects which were not available when the regex was defined. You can use placeholder<> by creating an object of type placeholder<T> and using that object in a semantic action exactly as you intend an object of type T to be used.placeholder<int> _i; placeholder<double> _d; sregex rex = ( some >> regex >> here ) [ ++_i, _d *= _d ]; Then, when doing a pattern match with either regex_search(), regex_match() or regex_replace(), pass a match_results<> object that contains bindings for the placeholders used in the regex object's semantic actions. You can create the bindings by calling match_results::let as follows:int i = 0; double d = 3.14; smatch what; what.let(_i = i) .let(_d = d); if(regex_match("some string", rex, what)) // i and d mutated here If a semantic action executes that contains an unbound placeholder, a exception of type regex_error is thrown.See the discussion for xpressive::let() and the "Referring to Non-Local Variables" section in the Users' Guide for more information.Example:// Define a placeholder for a map object: placeholder<std::map<std::string, int> > _map; // Match a word and an integer, separated by =>, // and then stuff the result into a std::map<> sregex pair = ( (s1= +_w) >> "=>" >> (s2= +_d) ) [ _map[s1] = as<int>(s2) ]; // Match one or more word/integer pairs, separated // by whitespace. sregex rx = pair >> *(+_s >> pair); // The string to parse std::string str("aaa=>1 bbb=>23 ccc=>456"); // Here is the actual map to fill in: std::map<std::string, int> result; // Bind the _map placeholder to the actual map smatch what; what.let( _map = result ); // Execute the match and fill in result map if(regex_match(str, what, rx)) { std::cout << result["aaa"] << '\n'; std::cout << result["bbb"] << '\n'; std::cout << result["ccc"] << '\n'; } unspecifiedT &The object to associate with this placeholder An object of unspecified type that records the association of t with *this. unspecifiedT const &This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. proto::extends< proto::terminal< reference_wrapper< T > >::type, reference< T > >reference<> is a lazy wrapper for a reference that can be used in xpressive semantic actions. Here is an example of how to use reference<> to create a lazy reference to an existing object so it can be read and written in an xpressive semantic action.using namespace boost::xpressive; std::map<std::string, int> result; reference<std::map<std::string, int> > result_ref(result); // Match a word and an integer, separated by =>, // and then stuff the result into a std::map<> sregex pair = ( (s1= +_w) >> "=>" >> (s2= +_d) ) [ result_ref[s1] = as<int>(s2) ]; T &Fetch the stored value. T &Reference to object Store a reference to t. Class template regex_compiler is a factory for building basic_regex objects from a string. Class template regex_compiler is used to construct a basic_regex object from a string. The string should contain a valid regular expression. You can imbue a regex_compiler object with a locale, after which all basic_regex objects created with that regex_compiler object will use that locale. After creating a regex_compiler object, and optionally imbueing it with a locale, you can call the compile() method to construct a basic_regex object, passing it the string representing the regular expression. You can call compile() multiple times on the same regex_compiler object. Two basic_regex objects compiled from the same string will have different regex_id's. locale_typelocale_typeThe locale that this regex_compiler should use. Specify the locale to be used by a regex_compiler. The previous locale. locale_typeGet the locale used by a regex_compiler. The locale used by this regex_compiler. basic_regex< BidiIter >InputIterThe beginning of a range of characters representing the regular expression to compile. InputIterThe end of a range of characters representing the regular expression to compile. flag_typeregex_constants::ECMAScriptOptional bitmask that determines how the pat string is interpreted. (See syntax_option_type.) Builds a basic_regex object from a range of characters. InputIter is a model of the InputIterator concept. [begin,end) is a valid range. The range of characters specified by [begin,end) contains a valid string-based representation of a regular expression. A basic_regex object corresponding to the regular expression represented by the character range. regex_error when the range of characters has invalid regular expression syntax. disable_if< is_pointer< InputRange >, basic_regex< BidiIter > >::typeInputRange const &flag_typeregex_constants::ECMAScriptThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. basic_regex< BidiIter >char_type const *flag_typeregex_constants::ECMAScriptThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. basic_regex< BidiIter >char_type const *std::size_tflag_typeThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. basic_regex< BidiIter > &string_type const &A std::string containing the name of the regular expression. Return a reference to the named regular expression. If no such named regular expression exists, create a new regular expression and return a reference to it. The string is not empty. bad_alloc on allocation failure. basic_regex< BidiIter > const &string_type const &This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. RegexTraits const &RegexTraits() boolchar_type boolmatch_results< BidiIter > const & regex_id_type value_type const & value_type const * regex_iterator< BidiIter > &If what.prefix().first != what[0].second and if the element match_prev_avail is not set in flags then sets it. Then behaves as if by calling regex_search(what[0].second, end, what, *pre, flags), with the following variation: in the event that the previous match found was of zero length (what[0].length() == 0) then attempts to find a non-zero length match starting at what[0].second, only if that fails and provided what[0].second != suffix().second does it look for a (possibly zero length) match starting from what[0].second + 1. If no further match is found then sets *this equal to the end of sequence iterator. (*this)->size() == pre->mark_count() + 1 (*this)->empty() == false (*this)->prefix().first == An iterator denoting the end point of the previous match found (*this)->prefix().last == (**this)[0].first (*this)->prefix().matched == (*this)->prefix().first != (*this)->prefix().second (*this)->suffix().first == (**this)[0].second (*this)->suffix().last == end (*this)->suffix().matched == (*this)->suffix().first != (*this)->suffix().second (**this)[0].first == The starting iterator for this match. (**this)[0].second == The ending iterator for this match. (**this)[0].matched == true if a full match was found, and false if it was a partial match (found as a result of the match_partial flag being set). (**this)[n].first == For all integers n < (*this)->size(), the start of the sequence that matched sub-expression n. Alternatively, if sub-expression n did not participate in the match, then end. (**this)[n].second == For all integers n < (*this)->size(), the end of the sequence that matched sub-expression n. Alternatively, if sub-expression n did not participate in the match, then end. (**this)[n].matched == For all integers n < (*this)->size(), true if sub-expression n participated in the match, false otherwise. (*this)->position() == The distance from the start of the original sequence being iterated, to the start of this match. regex_iterator< BidiIter >int BidiIterBidiIterbasic_regex< BidiIter > const &regex_constants::match_flag_typeregex_constants::match_default BidiIterBidiIterbasic_regex< BidiIter > const &unspecifiedregex_constants::match_flag_typeregex_constants::match_default regex_iterator< BidiIter > const & regex_iterator< BidiIter > &regex_iterator< BidiIter > const & value_type const & value_type const * regex_token_iterator< BidiIter > &If N == -1 then sets *this equal to the end of sequence iterator. Otherwise if N+1 < subs.size(), then increments N and sets result equal to ((subs[N] == -1) ? value_type(what.prefix().str()) : value_type(what[subs[N]].str())). Otherwise if what.prefix().first != what[0].second and if the element match_prev_avail is not set in flags then sets it. Then locates the next match as if by calling regex_search(what[0].second, end, what, *pre, flags), with the following variation: in the event that the previous match found was of zero length (what[0].length() == 0) then attempts to find a non-zero length match starting at what[0].second, only if that fails and provided what[0].second != suffix().second does it look for a (possibly zero length) match starting from what[0].second + 1. If such a match is found then sets N equal to zero, and sets result equal to ((subs[N] == -1) ? value_type(what.prefix().str()) : value_type(what[subs[N]].str())). Otherwise if no further matches were found, then let last_end be the endpoint of the last match that was found. Then if last_end != end and subs[0] == -1 sets N equal to -1 and sets result equal to value_type(last_end, end). Otherwise sets *this equal to the end of sequence iterator. regex_token_iterator< BidiIter >int *this is the end of sequence iterator. BidiIterThe beginning of the character range to search. BidiIterThe end of the character range to search. basic_regex< BidiIter > const &The regex pattern to search for. [begin,end) is a valid range. BidiIterThe beginning of the character range to search. BidiIterThe end of the character range to search. basic_regex< BidiIter > const &The regex pattern to search for. unspecifiedA let() expression with argument bindings for semantic actions. [begin,end) is a valid range. BidiIterThe beginning of the character range to search. BidiIterThe end of the character range to search. basic_regex< BidiIter > const &The regex pattern to search for. Subs const &A range of integers designating sub-matches to be treated as tokens. regex_constants::match_flag_typeregex_constants::match_defaultOptional match flags, used to control how the expression is matched against the sequence. (See match_flag_type.) [begin,end) is a valid range. subs is either an integer greater or equal to -1, or else an array or non-empty std::vector<> of such integers. BidiIterThe beginning of the character range to search. BidiIterThe end of the character range to search. basic_regex< BidiIter > const &The regex pattern to search for. Subs const &A range of integers designating sub-matches to be treated as tokens. unspecifiedA let() expression with argument bindings for semantic actions. regex_constants::match_flag_typeregex_constants::match_defaultOptional match flags, used to control how the expression is matched against the sequence. (See match_flag_type.) [begin,end) is a valid range. subs is either an integer greater or equal to -1, or else an array or non-empty std::vector<> of such integers. regex_token_iterator< BidiIter > const & *this == that regex_token_iterator< BidiIter > &regex_token_iterator< BidiIter > const & *this == that ImplThin wrapper around the default regex_traits implementation, either cpp_regex_traits or c_regex_traits locale_type const & std::pair< BidiIter, BidiIter >Class template sub_match denotes the sequence of characters matched by a particular marked sub-expression. When the marked sub-expression denoted by an object of type sub_match<> participated in a regular expression match then member matched evaluates to true, and members first and second denote the range of characters [first,second) which formed that match. Otherwise matched is false, and members first and second contained undefined values.If an object of type sub_match<> represents sub-expression 0 - that is to say the whole match - then member matched is always true, unless a partial match was obtained as a result of the flag match_partial being passed to a regular expression algorithm, in which case member matched is false, and members first and second represent the character range that formed the partial match. string_type string_type difference_type bool_type bool intstring_type const &the string against which to compare Performs a lexicographic string comparison. the results of (*this).str().compare(str) intsub_match const &This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. intvalue_type const *This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. BidiIterBidiIterboolfalse proto::extends< proto::terminal< T >::type, value< T > >value<> is a lazy wrapper for a value that can be used in xpressive semantic actions. Below is an example that shows where value<> is useful.sregex good_voodoo(boost::shared_ptr<int> pi) { using namespace boost::xpressive; // Use val() to hold the shared_ptr by value: sregex rex = +( _d [ ++*val(pi) ] >> '!' ); // OK, rex holds a reference count to the integer. return rex; } In the above code, xpressive::val() is a function that returns a value<> object. Had val() not been used here, the operation ++*pi would have been evaluated eagerly once, instead of lazily when the regex match happens. T &This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. T const &Fetch the stored value. Store a default-constructed T. T const &The initial value. Store a copy of t. as<> is a PolymorphicFunctionObject for lexically casting a parameter to a different type. TValue const &The value to lexically cast. boost::lexical_cast<T>(val) const_cast_<> is a PolymorphicFunctionObject for const-casting a parameter to a cv qualification. TValue const &The value to const-cast. Types T and Value differ only in cv-qualification. const_cast<T>(val) construct<> is a PolymorphicFunctionObject for constructing a new object. TThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. TA0 const &This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. TA0 const &A1 const &This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. TA0 const &The first argument to the constructor A1 const &The second argument to the constructor A2 const &The third argument to the constructor T(a0,a1,...) dynamic_cast_<> is a PolymorphicFunctionObject for dynamically casting a parameter to a different type. TValue const &The value to dynamically cast. dynamic_cast<T>(val) static_cast_<> is a PolymorphicFunctionObject for statically casting a parameter to a different type. TValue const &The value to statically cast. static_cast<T>(val) throw_<> is a PolymorphicFunctionObject for throwing an exception. voidThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. voidA0 const &This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. voidA0 const &A1 const &This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. voidA0 const &The first argument to the constructor A1 const &The second argument to the constructor A2 const &The third argument to the constructor This function makes use of the BOOST_THROW_EXCEPTION macro to actually throw the exception. See the documentation for the Boost.Exception library. <tt>Except(a0 void const * basic_regex< std::string::const_iterator > basic_regex< char const * > basic_regex< std::wstring::const_iterator > basic_regex< wchar_t const * > sub_match< std::string::const_iterator > sub_match< char const * > sub_match< std::wstring::const_iterator > sub_match< wchar_t const * > regex_compiler< std::string::const_iterator > regex_compiler< char const * > regex_compiler< std::wstring::const_iterator > regex_compiler< wchar_t const * > regex_iterator< std::string::const_iterator > regex_iterator< char const * > regex_iterator< std::wstring::const_iterator > regex_iterator< wchar_t const * > regex_token_iterator< std::string::const_iterator > regex_token_iterator< char const * > regex_token_iterator< std::wstring::const_iterator > regex_token_iterator< wchar_t const * > match_results< std::string::const_iterator > match_results< char const * > match_results< std::wstring::const_iterator > match_results< wchar_t const * > regex_id_filter_predicate< std::string::const_iterator > regex_id_filter_predicate< char const * > regex_id_filter_predicate< std::wstring::const_iterator > regex_id_filter_predicate< wchar_t const * >
Includes everything you need to write static regular expressions and use them.
Type registrations so that xpressive can be used with the Boost.Typeof library.