#include<compare>#include<initializer_list>namespacestd{// regex constantsnamespaceregex_constants{usingsyntax_option_type=/*T1*/;usingmatch_flag_type=/*T2*/;usingerror_type=/*T3*/;}// class regex_errorclassregex_error;// class template regex_traitstemplate<classCharT>structregex_traits;// class template basic_regextemplate<classCharT,classTraits=regex_traits<CharT>>classbasic_regex;usingregex=basic_regex<char>;usingwregex=basic_regex<wchar_t>;// basic_regex swaptemplate<classCharT,classTraits>voidswap(basic_regex<CharT,Traits>&e1,basic_regex<CharT,Traits>&e2);// class template sub_matchtemplate<classBiIt>classsub_match;usingcsub_match=sub_match<constchar*>;usingwcsub_match=sub_match<constwchar_t*>;usingssub_match=sub_match<string::const_iterator>;usingwssub_match=sub_match<wstring::const_iterator>;// sub_match non-member operatorstemplate<classBiIt>booloperator==(constsub_match<BiIt>&lhs,constsub_match<BiIt>&rhs);template<classBiIt>autooperator<=>(constsub_match<BiIt>&lhs,constsub_match<BiIt>&rhs);template<classBiIt,classST,classSA>booloperator==(constsub_match<BiIt>&lhs,constbasic_string<typenameiterator_traits<BiIt>::value_type,ST,SA>&rhs);template<classBiIt,classST,classSA>autooperator<=>(constsub_match<BiIt>&lhs,constbasic_string<typenameiterator_traits<BiIt>::value_type,ST,SA>&rhs);template<classBiIt>booloperator==(constsub_match<BiIt>&lhs,consttypenameiterator_traits<BiIt>::value_type*rhs);template<classBiIt>autooperator<=>(constsub_match<BiIt>&lhs,consttypenameiterator_traits<BiIt>::value_type*rhs);template<classBiIt>booloperator==(constsub_match<BiIt>&lhs,consttypenameiterator_traits<BiIt>::value_type&rhs);template<classBiIt>autooperator<=>(constsub_match<BiIt>&lhs,consttypenameiterator_traits<BiIt>::value_type&rhs);template<classCharT,classST,classBiIt>basic_ostream<CharT,ST>&operator<<(basic_ostream<CharT,ST>&os,constsub_match<BiIt>&m);// class template match_resultstemplate<classBiIt,classAllocator=allocator<sub_match<BiIt>>>classmatch_results;usingcmatch=match_results<constchar*>;usingwcmatch=match_results<constwchar_t*>;usingsmatch=match_results<string::const_iterator>;usingwsmatch=match_results<wstring::const_iterator>;// match_results comparisonstemplate<classBiIt,classAllocator>booloperator==(constmatch_results<BiIt,Allocator>&m1,constmatch_results<BiIt,Allocator>&m2);// match_results swaptemplate<classBiIt,classAllocator>voidswap(match_results<BiIt,Allocator>&m1,match_results<BiIt,Allocator>&m2);// function template regex_matchtemplate<classBiIt,classAllocator,classCharT,classTraits>boolregex_match(BiItfirst,BiItlast,match_results<BiIt,Allocator>&m,constbasic_regex<CharT,Traits>&e,regex_constants::match_flag_typeflags=regex_constants::match_default);template<classBiIt,classCharT,classTraits>boolregex_match(BiItfirst,BiItlast,constbasic_regex<CharT,Traits>&e,regex_constants::match_flag_typeflags=regex_constants::match_default);template<classCharT,classAllocator,classTraits>boolregex_match(constCharT*str,match_results<constCharT*,Allocator>&m,constbasic_regex<CharT,Traits>&e,regex_constants::match_flag_typeflags=regex_constants::match_default);template<classST,classSA,classAllocator,classCharT,classTraits>boolregex_match(constbasic_string<CharT,ST,SA>&s,match_results<typenamebasic_string<CharT,ST,SA>::const_iterator,Allocator>&m,constbasic_regex<CharT,Traits>&e,regex_constants::match_flag_typeflags=regex_constants::match_default);template<classST,classSA,classAllocator,classCharT,classTraits>boolregex_match(constbasic_string<CharT,ST,SA>&&,match_results<typenamebasic_string<CharT,ST,SA>::const_iterator,Allocator>&,constbasic_regex<CharT,Traits>&,regex_constants::match_flag_type=regex_constants::match_default)=delete;template<classCharT,classTraits>boolregex_match(constCharT*str,constbasic_regex<CharT,Traits>&e,regex_constants::match_flag_typeflags=regex_constants::match_default);template<classST,classSA,classCharT,classTraits>boolregex_match(constbasic_string<CharT,ST,SA>&s,constbasic_regex<CharT,Traits>&e,regex_constants::match_flag_typeflags=regex_constants::match_default);// function template regex_searchtemplate<classBiIt,classAllocator,classCharT,classTraits>boolregex_search(BiItfirst,BiItlast,match_results<BiIt,Allocator>&m,constbasic_regex<CharT,Traits>&e,regex_constants::match_flag_typeflags=regex_constants::match_default);template<classBiIt,classCharT,classTraits>boolregex_search(BiItfirst,BiItlast,constbasic_regex<CharT,Traits>&e,regex_constants::match_flag_typeflags=regex_constants::match_default);template<classCharT,classAllocator,classTraits>boolregex_search(constCharT*str,match_results<constCharT*,Allocator>&m,constbasic_regex<CharT,Traits>&e,regex_constants::match_flag_typeflags=regex_constants::match_default);template<classCharT,classTraits>boolregex_search(constCharT*str,constbasic_regex<CharT,Traits>&e,regex_constants::match_flag_typeflags=regex_constants::match_default);template<classST,classSA,classCharT,classTraits>boolregex_search(constbasic_string<CharT,ST,SA>&s,constbasic_regex<CharT,Traits>&e,regex_constants::match_flag_typeflags=regex_constants::match_default);template<classST,classSA,classAllocator,classCharT,classTraits>boolregex_search(constbasic_string<CharT,ST,SA>&s,match_results<typenamebasic_string<CharT,ST,SA>::const_iterator,Allocator>&m,constbasic_regex<CharT,Traits>&e,regex_constants::match_flag_typeflags=regex_constants::match_default);template<classST,classSA,classAllocator,classCharT,classTraits>boolregex_search(constbasic_string<CharT,ST,SA>&&,match_results<typenamebasic_string<CharT,ST,SA>::const_iterator,Allocator>&,constbasic_regex<CharT,Traits>&,regex_constants::match_flag_type=regex_constants::match_default)=delete;// function template regex_replacetemplate<classOutputIt,classBiIt,classTraits,classCharT,classST,classSA>OutputItregex_replace(OutputItout,BiItfirst,BiItlast,constbasic_regex<CharT,Traits>&e,constbasic_string<CharT,ST,SA>&fmt,regex_constants::match_flag_typeflags=regex_constants::match_default);template<classOutputIt,classBiIt,classTraits,classCharT>OutputItregex_replace(OutputItout,BiItfirst,BiItlast,constbasic_regex<CharT,Traits>&e,constCharT*fmt,regex_constants::match_flag_typeflags=regex_constants::match_default);template<classTraits,classCharT,classST,classSA,classFST,classFSA>basic_string<CharT,ST,SA>regex_replace(constbasic_string<CharT,ST,SA>&s,constbasic_regex<CharT,Traits>&e,constbasic_string<CharT,FST,FSA>&fmt,regex_constants::match_flag_typeflags=regex_constants::match_default);template<classTraits,classCharT,classST,classSA>basic_string<CharT,ST,SA>regex_replace(constbasic_string<CharT,ST,SA>&s,constbasic_regex<CharT,Traits>&e,constCharT*fmt,regex_constants::match_flag_typeflags=regex_constants::match_default);template<classTraits,classCharT,classST,classSA>basic_string<CharT>regex_replace(constCharT*s,constbasic_regex<CharT,Traits>&e,constbasic_string<CharT,ST,SA>&fmt,regex_constants::match_flag_typeflags=regex_constants::match_default);template<classTraits,classCharT>basic_string<CharT>regex_replace(constCharT*s,constbasic_regex<CharT,Traits>&e,constCharT*fmt,regex_constants::match_flag_typeflags=regex_constants::match_default);// class template regex_iteratortemplate<classBiIt,classCharT=typenameiterator_traits<BiIt>::value_type,classTraits=regex_traits<CharT>>classregex_iterator;usingcregex_iterator=regex_iterator<constchar*>;usingwcregex_iterator=regex_iterator<constwchar_t*>;usingsregex_iterator=regex_iterator<string::const_iterator>;usingwsregex_iterator=regex_iterator<wstring::const_iterator>;// class template regex_token_iteratortemplate<classBiIt,classCharT=typenameiterator_traits<BiIt>::value_type,classTraits=regex_traits<CharT>>classregex_token_iterator;usingcregex_token_iterator=regex_token_iterator<constchar*>;usingwcregex_token_iterator=regex_token_iterator<constwchar_t*>;usingsregex_token_iterator=regex_token_iterator<string::const_iterator>;usingwsregex_token_iterator=regex_token_iterator<wstring::const_iterator>;namespacepmr{template<classBiIt>usingmatch_results=std::match_results<BiIt,polymorphic_allocator<sub_match<BiIt>>>;usingcmatch=match_results<constchar*>;usingwcmatch=match_results<constwchar_t*>;usingsmatch=match_results<string::const_iterator>;usingwsmatch=match_results<wstring::const_iterator>;}}namespacestd::regex_constants{usingsyntax_option_type=/*T1*/;inlineconstexprsyntax_option_typeicase=/* unspecified */;inlineconstexprsyntax_option_typenosubs=/* unspecified */;inlineconstexprsyntax_option_typeoptimize=/* unspecified */;inlineconstexprsyntax_option_typecollate=/* unspecified */;inlineconstexprsyntax_option_typeECMAScript=/* unspecified */;inlineconstexprsyntax_option_typebasic=/* unspecified */;inlineconstexprsyntax_option_typeextended=/* unspecified */;inlineconstexprsyntax_option_typeawk=/* unspecified */;inlineconstexprsyntax_option_typegrep=/* unspecified */;inlineconstexprsyntax_option_typeegrep=/* unspecified */;inlineconstexprsyntax_option_typemultiline=/* unspecified */;}namespacestd::regex_constants{usingmatch_flag_type=/*T2*/;inlineconstexprmatch_flag_typematch_default={};inlineconstexprmatch_flag_typematch_not_bol=/* unspecified */;inlineconstexprmatch_flag_typematch_not_eol=/* unspecified */;inlineconstexprmatch_flag_typematch_not_bow=/* unspecified */;inlineconstexprmatch_flag_typematch_not_eow=/* unspecified */;inlineconstexprmatch_flag_typematch_any=/* unspecified */;inlineconstexprmatch_flag_typematch_not_null=/* unspecified */;inlineconstexprmatch_flag_typematch_continuous=/* unspecified */;inlineconstexprmatch_flag_typematch_prev_avail=/* unspecified */;inlineconstexprmatch_flag_typeformat_default={};inlineconstexprmatch_flag_typeformat_sed=/* unspecified */;inlineconstexprmatch_flag_typeformat_no_copy=/* unspecified */;inlineconstexprmatch_flag_typeformat_first_only=/* unspecified */;}namespacestd::regex_constants{usingerror_type=/*T3*/;inlineconstexprerror_typeerror_collate=/* unspecified */;inlineconstexprerror_typeerror_ctype=/* unspecified */;inlineconstexprerror_typeerror_escape=/* unspecified */;inlineconstexprerror_typeerror_backref=/* unspecified */;inlineconstexprerror_typeerror_brack=/* unspecified */;inlineconstexprerror_typeerror_paren=/* unspecified */;inlineconstexprerror_typeerror_brace=/* unspecified */;inlineconstexprerror_typeerror_badbrace=/* unspecified */;inlineconstexprerror_typeerror_range=/* unspecified */;inlineconstexprerror_typeerror_space=/* unspecified */;inlineconstexprerror_typeerror_badrepeat=/* unspecified */;inlineconstexprerror_typeerror_complexity=/* unspecified */;inlineconstexprerror_typeerror_stack=/* unspecified */;}namespacestd{classregex_error:publicruntime_error{public:explicitregex_error(regex_constants::error_typeecode);regex_constants::error_typecode()const;};}namespacestd{template<classCharT>structregex_traits{usingchar_type=CharT;usingstring_type=basic_string<char_type>;usinglocale_type=locale;usingchar_class_type=/* bitmask-type */;regex_traits();staticsize_tlength(constchar_type*p);CharTtranslate(CharTc)const;CharTtranslate_nocase(CharTc)const;template<classForwardIt>string_typetransform(ForwardItfirst,ForwardItlast)const;template<classForwardIt>string_typetransform_primary(ForwardItfirst,ForwardItlast)const;template<classForwardIt>string_typelookup_collatename(ForwardItfirst,ForwardItlast)const;template<classForwardIt>char_class_typelookup_classname(ForwardItfirst,ForwardItlast,boolicase=false)const;boolisctype(CharTc,char_class_typef)const;intvalue(CharTch,intradix)const;locale_typeimbue(locale_typel);locale_typegetloc()const;};}namespacestd{template<classCharT,classTraits=regex_traits<CharT>>classbasic_regex{public:// typesusingvalue_type=CharT;usingTraits_type=Traits;usingstring_type=typenameTraits::string_type;usingflag_type=regex_constants::syntax_option_type;usinglocale_type=typenameTraits::locale_type;// constantsstaticconstexprflag_typeicase=regex_constants::icase;staticconstexprflag_typenosubs=regex_constants::nosubs;staticconstexprflag_typeoptimize=regex_constants::optimize;staticconstexprflag_typecollate=regex_constants::collate;staticconstexprflag_typeECMAScript=regex_constants::ECMAScript;staticconstexprflag_typebasic=regex_constants::basic;staticconstexprflag_typeextended=regex_constants::extended;staticconstexprflag_typeawk=regex_constants::awk;staticconstexprflag_typegrep=regex_constants::grep;staticconstexprflag_typeegrep=regex_constants::egrep;staticconstexprflag_typemultiline=regex_constants::multiline;// construct/copy/destroybasic_regex();explicitbasic_regex(constCharT*p,flag_typef=regex_constants::ECMAScript);basic_regex(constCharT*p,size_tlen,flag_typef=regex_constants::ECMAScript);basic_regex(constbasic_regex&);basic_regex(basic_regex&&)noexcept;template<classST,classSA>explicitbasic_regex(constbasic_string<CharT,ST,SA>&s,flag_typef=regex_constants::ECMAScript);template<classForwardIt>basic_regex(ForwardItfirst,ForwardItlast,flag_typef=regex_constants::ECMAScript);basic_regex(initializer_list<CharT>il,flag_typef=regex_constants::ECMAScript);~basic_regex();// assignbasic_regex&operator=(constbasic_regex&e);basic_regex&operator=(basic_regex&&e)noexcept;basic_regex&operator=(constCharT*p);basic_regex&operator=(initializer_list<CharT>il);template<classST,classSA>basic_regex&operator=(constbasic_string<CharT,ST,SA>&s);basic_regex&assign(constbasic_regex&e);basic_regex&assign(basic_regex&&e)noexcept;basic_regex&assign(constCharT*p,flag_typef=regex_constants::ECMAScript);basic_regex&assign(constCharT*p,size_tlen,flag_typef=regex_constants::ECMAScript);template<classST,classSA>basic_regex&assign(constbasic_string<CharT,ST,SA>&s,flag_typef=regex_constants::ECMAScript);template<classInputIt>basic_regex&assign(InputItfirst,InputItlast,flag_typef=regex_constants::ECMAScript);basic_regex&assign(initializer_list<CharT>,flag_typef=regex_constants::ECMAScript);// const operationsunsignedmark_count()const;flag_typeflags()const;// localelocale_typeimbue(locale_typeloc);locale_typegetloc()const;// swapvoidswap(basic_regex&);};template<classForwardIt>basic_regex(ForwardIt,ForwardIt,regex_constants::syntax_option_type=regex_constants::ECMAScript)->basic_regex<typenameiterator_traits<ForwardIt>::value_type>;}namespacestd{template<classBiIt>classsub_match:publicpair<BiIt,BiIt>{public:usingvalue_type=typenameiterator_traits<BiIt>::value_type;usingdifference_type=typenameiterator_traits<BiIt>::difference_type;usingiterator=BiIt;usingstring_type=basic_string<value_type>;boolmatched;constexprsub_match();difference_typelength()const;operatorstring_type()const;string_typestr()const;intcompare(constsub_match&s)const;intcompare(conststring_type&s)const;intcompare(constvalue_type*s)const;voidswap(sub_match&s)noexcept(/* see description */);};}namespacestd{template<classBiIt,classAllocator=allocator<sub_match<BiIt>>>classmatch_results{public:usingvalue_type=sub_match<BiIt>;usingconst_reference=constvalue_type&;usingreference=value_type&;usingconst_iterator=/* implementation-defined */;usingiterator=const_iterator;usingdifference_type=typenameiterator_traits<BiIt>::difference_type;usingsize_type=typenameallocator_traits<Allocator>::size_type;usingallocator_type=Allocator;usingchar_type=typenameiterator_traits<BiIt>::value_type;usingstring_type=basic_string<char_type>;// construct/copy/destroymatch_results():match_results(Allocator()){}explicitmatch_results(constAllocator&a);match_results(constmatch_results&m);match_results(constmatch_results&m,constAllocator&a);match_results(match_results&&m)noexcept;match_results(match_results&&m,constAllocator&a);match_results&operator=(constmatch_results&m);match_results&operator=(match_results&&m);~match_results();// stateboolready()const;// sizesize_typesize()const;size_typemax_size()const;boolempty()const;// element accessdifference_typelength(size_typesub=0)const;difference_typeposition(size_typesub=0)const;string_typestr(size_typesub=0)const;const_referenceoperator[](size_typen)const;const_referenceprefix()const;const_referencesuffix()const;const_iteratorbegin()const;const_iteratorend()const;const_iteratorcbegin()const;const_iteratorcend()const;// formattemplate<classOutputIt>OutputItformat(OutputItout,constchar_type*fmt_first,constchar_type*fmt_last,regex_constants::match_flag_typeflags=regex_constants::format_default)const;template<classOutputIt,classST,classSA>OutputItformat(OutputItout,constbasic_string<char_type,ST,SA>&fmt,regex_constants::match_flag_typeflags=regex_constants::format_default)const;template<classST,classSA>basic_string<char_type,ST,SA>format(constbasic_string<char_type,ST,SA>&fmt,regex_constants::match_flag_typeflags=regex_constants::format_default)const;string_typeformat(constchar_type*fmt,regex_constants::match_flag_typeflags=regex_constants::format_default)const;// allocatorallocator_typeget_allocator()const;// swapvoidswap(match_results&that);};}