![]() |
Home | Libraries | People | FAQ | More |
boost::xpressive::regex_compiler — Class template regex_compiler is a factory for building basic_regex objects from a string.
// In header: <boost/xpressive/regex_compiler.hpp> template<typename BidiIter, typename RegexTraits, typename CompilerTraits> struct regex_compiler { // types typedef ; typedef ; typedef ; typedef ; typedef ; typedef ; typedef ; // construct/copy/destruct ( = ); // public member functions (); () ; template<typename InputIter> basic_regex< (, , = ); template<typename InputRange> basic_regex< (, = ); basic_regex< (, = ); basic_regex< (, , ); basic_regex< (); basic_regex< () ; // private member functions () ; };
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.
regex_compiler
public member functions( loc);
Specify the locale to be used by a regex_compiler
.
Parameters: |
|
||
Returns: |
The previous locale. |
() ;
Get the locale used by a regex_compiler
.
Returns: |
The locale used by this regex_compiler. |
template<typename InputIter> basic_regex< ( begin, end, flags = );
Builds a basic_regex
object from a range of characters.
Parameters: |
|
||||||
Requires: |
InputIter is a model of the InputIterator concept. |
||||||
Requires: |
[begin,end) is a valid range. |
||||||
Requires: |
The range of characters specified by [begin,end) contains a valid string-based representation of a regular expression. |
||||||
Returns: |
A basic_regex object corresponding to the regular expression represented by the character range. |
||||||
Throws: |
regex_error when the range of characters has invalid regular expression syntax. |
template<typename InputRange> basic_regex< ( pat, flags = );
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
basic_regex< ( begin, flags = );
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
basic_regex< ( begin, size, flags);
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
basic_regex< ( name);
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.
Parameters: |
|
||
Requires: |
The string is not empty. |
||
Throws: |
bad_alloc on allocation failure. |
basic_regex< ( name) ;
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.