Description

Include the TR1 header <regex> to define a template class to parse regular expressions and several template classes and functions to search text for matches to a regular expression object.

Note: To enable this header file, you must define the macro __IBMCPP_TR1__ .

To create a regular expression object use the template class basic_regex or one of its specializations, regex and wregex, along with the syntax flags of type syntax_option_type.

To search text for matches to a regular expression object use the template functions regex_match and regex_search, along with the match flags of type match_flag_type. These functions return their results using the template class match_results and its specializations, cmatch, wcmatch, smatch, and wsmatch, along with the template class sub_match and its specializations, csub_match, wcsub_match, ssub_match, and wssub_match.

To replace text that matches a regular expression object use the template function regex_replace, along with the match flags of type match_flag_type.

To iterate through multiple matches of a regular expression object use the template classes regex_iterator and regex_token_iterator or one of their specializations, cregex_iterator, sregex_iterator, wcregex_iterator, wsregex_iterator, cregex_token_iterator, sregex_token_iterator, wcregex_token_iterator, and wsregex_token_iterator, along with the match flags of type match_flag_type.

To modify some of the details of the grammar of regular expressions write a class that implements the regular expression traits.