11 KiB
[re.syn]
28 Text processing library [text]
28.6 Regular expressions library [re]
28.6.3 Header synopsis [re.syn]
#include // see [compare.syn]#include <initializer_list> // see [initializer.list.syn]namespace std {// [re.const], regex constantsnamespace regex_constants {using syntax_option_type = T1; using match_flag_type = T2; using error_type = T3; }// [re.badexp], class regex_errorclass regex_error; // [re.traits], class template regex_traitstemplate struct regex_traits; // [re.regex], class template basic_regextemplate<class charT, class traits = regex_traits> class basic_regex; using regex = basic_regex; using wregex = basic_regex<wchar_t>; // [re.regex.swap], basic_regex swaptemplate<class charT, class traits>void swap(basic_regex<charT, traits>& e1, basic_regex<charT, traits>& e2); // [re.submatch], class template sub_matchtemplateclass sub_match; using csub_match = sub_match<const char*>; using wcsub_match = sub_match<const wchar_t*>; using ssub_match = sub_matchstring::const_iterator; using wssub_match = sub_matchwstring::const_iterator; // [re.submatch.op], sub_match non-member operatorstemplatebool operator==(const sub_match& lhs, const sub_match& rhs); templateauto operator<=>(const sub_match& lhs, const sub_match& rhs); template<class BiIter, class ST, class SA>bool operator==(const sub_match& lhs, const basic_string<typename iterator_traits::value_type, ST, SA>& rhs); template<class BiIter, class ST, class SA>auto operator<=>(const sub_match& lhs, const basic_string<typename iterator_traits::value_type, ST, SA>& rhs); templatebool operator==(const sub_match& lhs, const typename iterator_traits::value_type* rhs); templateauto operator<=>(const sub_match& lhs, const typename iterator_traits::value_type* rhs); templatebool operator==(const sub_match& lhs, const typename iterator_traits::value_type& rhs); templateauto operator<=>(const sub_match& lhs, const typename iterator_traits::value_type& rhs); template<class charT, class ST, class BiIter> basic_ostream<charT, ST>&operator<<(basic_ostream<charT, ST>& os, const sub_match& m); // [re.results], class template match_resultstemplate<class BidirectionalIterator, class Allocator = allocator<sub_match>>class match_results; using cmatch = match_results<const char*>; using wcmatch = match_results<const wchar_t*>; using smatch = match_resultsstring::const_iterator; using wsmatch = match_resultswstring::const_iterator; // match_results comparisonstemplate<class BidirectionalIterator, class Allocator>bool operator==(const match_results<BidirectionalIterator, Allocator>& m1, const match_results<BidirectionalIterator, Allocator>& m2); // [re.results.swap], match_results swaptemplate<class BidirectionalIterator, class Allocator>void swap(match_results<BidirectionalIterator, Allocator>& m1, match_results<BidirectionalIterator, Allocator>& m2); // [re.alg.match], function template regex_matchtemplate<class BidirectionalIterator, class Allocator, class charT, class traits>bool regex_match(BidirectionalIterator first, BidirectionalIterator last, match_results<BidirectionalIterator, Allocator>& m, const basic_regex<charT, traits>& e, regex_constants::match_flag_type flags = regex_constants::match_default); template<class BidirectionalIterator, class charT, class traits>bool regex_match(BidirectionalIterator first, BidirectionalIterator last, const basic_regex<charT, traits>& e, regex_constants::match_flag_type flags = regex_constants::match_default); template<class charT, class Allocator, class traits>bool regex_match(const charT* str, match_results<const charT*, Allocator>& m, const basic_regex<charT, traits>& e, regex_constants::match_flag_type flags = regex_constants::match_default); template<class ST, class SA, class Allocator, class charT, class traits>bool regex_match(const basic_string<charT, ST, SA>& s, match_results<typename basic_string<charT, ST, SA>::const_iterator, Allocator>& m, const basic_regex<charT, traits>& e, regex_constants::match_flag_type flags = regex_constants::match_default); template<class ST, class SA, class Allocator, class charT, class traits>bool regex_match(const basic_string<charT, ST, SA>&&, match_results<typename basic_string<charT, ST, SA>::const_iterator, Allocator>&, const basic_regex<charT, traits>&, regex_constants::match_flag_type = regex_constants::match_default) = delete; template<class charT, class traits>bool regex_match(const charT* str, const basic_regex<charT, traits>& e, regex_constants::match_flag_type flags = regex_constants::match_default); template<class ST, class SA, class charT, class traits>bool regex_match(const basic_string<charT, ST, SA>& s, const basic_regex<charT, traits>& e, regex_constants::match_flag_type flags = regex_constants::match_default); // [re.alg.search], function template regex_searchtemplate<class BidirectionalIterator, class Allocator, class charT, class traits>bool regex_search(BidirectionalIterator first, BidirectionalIterator last, match_results<BidirectionalIterator, Allocator>& m, const basic_regex<charT, traits>& e, regex_constants::match_flag_type flags = regex_constants::match_default); template<class BidirectionalIterator, class charT, class traits>bool regex_search(BidirectionalIterator first, BidirectionalIterator last, const basic_regex<charT, traits>& e, regex_constants::match_flag_type flags = regex_constants::match_default); template<class charT, class Allocator, class traits>bool regex_search(const charT* str, match_results<const charT*, Allocator>& m, const basic_regex<charT, traits>& e, regex_constants::match_flag_type flags = regex_constants::match_default); template<class charT, class traits>bool regex_search(const charT* str, const basic_regex<charT, traits>& e, regex_constants::match_flag_type flags = regex_constants::match_default); template<class ST, class SA, class charT, class traits>bool regex_search(const basic_string<charT, ST, SA>& s, const basic_regex<charT, traits>& e, regex_constants::match_flag_type flags = regex_constants::match_default); template<class ST, class SA, class Allocator, class charT, class traits>bool regex_search(const basic_string<charT, ST, SA>& s, match_results<typename basic_string<charT, ST, SA>::const_iterator, Allocator>& m, const basic_regex<charT, traits>& e, regex_constants::match_flag_type flags = regex_constants::match_default); template<class ST, class SA, class Allocator, class charT, class traits>bool regex_search(const basic_string<charT, ST, SA>&&, match_results<typename basic_string<charT, ST, SA>::const_iterator, Allocator>&, const basic_regex<charT, traits>&, regex_constants::match_flag_type = regex_constants::match_default) = delete; // [re.alg.replace], function template regex_replacetemplate<class OutputIterator, class BidirectionalIterator, class traits, class charT, class ST, class SA> OutputIterator regex_replace(OutputIterator out, BidirectionalIterator first, BidirectionalIterator last, const basic_regex<charT, traits>& e, const basic_string<charT, ST, SA>& fmt, regex_constants::match_flag_type flags = regex_constants::match_default); template<class OutputIterator, class BidirectionalIterator, class traits, class charT> OutputIterator regex_replace(OutputIterator out, BidirectionalIterator first, BidirectionalIterator last, const basic_regex<charT, traits>& e, const charT* fmt, regex_constants::match_flag_type flags = regex_constants::match_default); template<class traits, class charT, class ST, class SA, class FST, class FSA> basic_string<charT, ST, SA> regex_replace(const basic_string<charT, ST, SA>& s, const basic_regex<charT, traits>& e, const basic_string<charT, FST, FSA>& fmt, regex_constants::match_flag_type flags = regex_constants::match_default); template<class traits, class charT, class ST, class SA> basic_string<charT, ST, SA> regex_replace(const basic_string<charT, ST, SA>& s, const basic_regex<charT, traits>& e, const charT* fmt, regex_constants::match_flag_type flags = regex_constants::match_default); template<class traits, class charT, class ST, class SA> basic_string regex_replace(const charT* s, const basic_regex<charT, traits>& e, const basic_string<charT, ST, SA>& fmt, regex_constants::match_flag_type flags = regex_constants::match_default); template<class traits, class charT> basic_string regex_replace(const charT* s, const basic_regex<charT, traits>& e, const charT* fmt, regex_constants::match_flag_type flags = regex_constants::match_default); // [re.regiter], class template regex_iteratortemplate<class BidirectionalIterator, class charT = typename iterator_traits::value_type, class traits = regex_traits>class regex_iterator; using cregex_iterator = regex_iterator<const char*>; using wcregex_iterator = regex_iterator<const wchar_t*>; using sregex_iterator = regex_iteratorstring::const_iterator; using wsregex_iterator = regex_iteratorwstring::const_iterator; // [re.tokiter], class template regex_token_iteratortemplate<class BidirectionalIterator, class charT = typename iterator_traits::value_type, class traits = regex_traits>class regex_token_iterator; using cregex_token_iterator = regex_token_iterator<const char*>; using wcregex_token_iterator = regex_token_iterator<const wchar_t*>; using sregex_token_iterator = regex_token_iteratorstring::const_iterator; using wsregex_token_iterator = regex_token_iteratorwstring::const_iterator; namespace pmr {templateusing match_results = std::match_results<BidirectionalIterator, polymorphic_allocator<sub_match>>; using cmatch = match_results<const char*>; using wcmatch = match_results<const wchar_t*>; using smatch = match_resultsstring::const_iterator; using wsmatch = match_resultswstring::const_iterator; }}