Synopsis

namespace std {
    namespace tr1 {

 // TEMPLATE CLASS regex_traits AND basic_regex
 template<class Elem>
    struct regex_traits;
 template<>
    struct regex_traits<char>;
 template<>
    struct regex_traits<wchar_t>;
 template<class Elem,
    class RXtraits = regex_traits<Elem>,
    class basic_regex;
 typedef basic_regex<char> regex;
 typedef basic_regex<wchar_t> wregex;

 // TEMPLATE CLASS sub_match
 template<class BidIt>
    class sub_match;
 typedef sub_match<const char*> csub_match;
 typedef sub_match<const wchar_t*> wcsub_match;
 typedef sub_match<string::const_iterator> ssub_match;
 typedef sub_match<wstring::const_iterator> wssub_match;

 // TEMPLATE CLASS match_results
 template<class BidIt,
    class Alloc = allocator<typename iterator_traits<BidIt>::value_type> >
    class match_results;
 typedef match_results<const char*> cmatch;
 typedef match_results<const wchar_t*> wcmatch;
 typedef match_results<string::const_iterator> smatch;
 typedef match_results<wstring::const_iterator> wsmatch;

  // NAMESPACE regex_constants
        namespace regex_constants {
  typedef T1 syntax_option_type;
  static const syntax_option_type awk, basic, collate, ECMAScript,
    egrep, extended, grep, icase, nosubs, optimize;
  typedef T2 match_flag_type;
  static const match_flag_type match_any, match_default, match_not_bol,
    match_not_bow, match_continuous, match_not_eol, match_not_eow,
    match_not_null, match_partial, match_prev_avail;
  typedef T3 error_type;
  static const error_type error_badbrace, error_badrepeat, error_brace,
    error_brack, error_collate, error_complexity, error_ctype,
    error_escape, error_paren, error_range, error_space,
    error_stack, error_backref;
        }  // namespace regex_constants

 // CLASS regex_error
 class regex_error;

 // TEMPLATE FUNCTION regex_match
 template<class BidIt, class Alloc, class Elem, class RXtraits>
    bool regex_match(BidIt first, Bidit last,
        match_results<BidIt, Alloc>& match,
        const basic_regex<Elem, RXtraits>& re,
        match_flag_type flags = match_default);
 template<class BidIt, class Elem, class RXtraits>
    bool regex_match(BidIt first, Bidit last,
        const basic_regex<Elem, RXtraits>& re,
        match_flag_type flags = match_default);

 template<class Elem, class Alloc, class RXtraits>
    bool regex_match(const Elem* ptr,
        match_results<const Elem*, Alloc>& match,
        const basic_regex<Elem, RXtraits>& re,
        match_flag_type flags = match_default);
 template<class Elem, class RXtraits>
    bool regex_match(const Elem* ptr,
        const basic_regex<Elem, RXtraits>& re,
        match_flag_type flags = match_default);

 template<class IOtraits, class IOalloc, class Alloc, class Elem, class RXtraits>
    bool regex_match(
        const basic_string<Elem, IOtraits, IOalloc>& str,
        match_results<typename basic_string<Elem, IOtraits, IOalloc>::
        const_iterator, Alloc>& match,
        const basic_regex<Elem, RXtraits>& re,
        match_flag_type flags= match_default);
 template<class IOtraits, class IOalloc, class Elem, class RXtraits>
    bool regex_match(
        const basic_string<Elem, IOtraits, IOalloc>& match,
        const basic_regex<Elem, RXtraits>& re,
        match_flag_type flags = match_default);

 // TEMPLATE FUNCTION regex_search
 template<class BidIt, class Alloc, class Elem, class RXtraits>
    bool regex_search(BidIt first, Bidit last,
        match_results<BidIt, Alloc>& match,
        const basic_regex<Elem, RXtraits>& re,
        match_flag_type flags = match_default);
 template<class BidIt, class Elem, class RXtraits>
    bool regex_search(BidIt first, Bidit last,
        const basic_regex<Elem, RXtraits>& re,
        match_flag_type flags = match_default);

 template<class Elem, class Alloc, class RXtraits>
    bool regex_search(const Elem* ptr,
        match_results<const Elem*, Alloc>& match,
        const basic_regex<Elem, RXtraits>& re,
        match_flag_type flags = match_default);
 template<class Elem, class RXtraits>
    bool regex_search(const Elem* ptr,
        const basic_regex<Elem, RXtraits>& re,
        match_flag_type flags = match_default);

 template<class IOtraits, class IOalloc, class Alloc, class Elem, class RXtraits>
    bool regex_search(
        const basic_string<Elem, IOtraits, IOalloc>& str,
        match_results<typename basic_string<Elem, IOtraits, IOalloc>::
        const_iterator, Alloc>& match,
        const basic_regex<Elem, RXtraits>& re,
        match_flag_type flags = match_default);
 template<class IOtraits, class IOalloc, class Elem, class RXtraits>
    bool regex_search(
        const basic_string<Elem, IOtraits, IOalloc>& str,
        const basic_regex<Elem, RXtraits>& re,
        match_flag_type flags = match_default);

 // TEMPLATE FUNCTION regex_replace
 template<class OutIt, class BidIt, class RXtraits, class Elem>
    OutIt regex_replace(OutIt out, BidIt first, BidIt last,
        const basic_regex<Elem, RXtraits>& re,
        const basic_string<Elem>& fmt,
        match_flag_type flags = match_default);
 template<class RXtraits, class Elem>
    basic_string<Elem> regex_replace(
        const basic_string<Elem>& str,
        const basic_regex<Elem, RXtraits>& re,
        const basic_string<Elem>& fmt,
        match_flag_type flags = match_default);

 // REGULAR EXPRESSION ITERATORS
 template<class BidIt, class Elem = iterator_traits<BidIt>::value_type,
    class RXtraits = regex_traits<Elem> >
        class regex_iterator;
 typedef regex_iterator<const char*> cregex_iterator;
 typedef regex_iterator<const wchar_t*> wcregex_iterator;
 typedef regex_iterator<string::const_iterator> sregex_iterator;
 typedef regex_iterator<wstring::const_iterator> wsregex_iterator;

 template<class BidIt, class Elem = iterator_traits<BidIt>::value_type,
    class RXtraits = regex_traits<Elem> >
        class regex_token_iterator;
 typedef regex_token_iterator<const char*> cregex_token_iterator;
 typedef regex_token_iterator<const wchar_t*> wcregex_token_iterator;
 typedef regex_token_iterator<string::const_iterator> sregex_token_iterator;
 typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;

 // STREAM INSERTER
 template<class Elem, class IOtraits, class Alloc, class BidIt>
    basic_ostream<Elem, IOtraits>&
    operator<<(
        basic_ostream<Elem, IOtraits>& os,
        const sub_match<BidIt>& submatch);

 // TEMPLATE swap FUNCTIONS
 template<class Elem, class RXtraits>
    void swap(
        basic_regex<Elem, RXtraits>& left,
        basic_regex<Elem, RXtraits>& right) throw();
 template<class Elem, class IOtraits, class BidIt, class Alloc>
    void swap(
        match_results<BidIt, Alloc>& left,
        match_results<BidIt, Alloc>& right) throw();

 // COMPARISON OPERATORS FOR match_results
 template<class BidIt, class Alloc>
    bool operator==(
        const match_results<BidIt, Alloc>& left,
        const match_results<BidIt, Alloc>& right);
 template<class BidIt, class Alloc>
    bool operator!=(
        const match_results<BidIt, Alloc>& left,
        const match_results<BidIt, Alloc>& right);

 // COMPARISON OPERATORS FOR sub_match
 template<class BidIt>
    bool operator==(
        const sub_match<BidIt>& left,
        const sub_match<BidIt>& right);
 template<class BidIt>
    bool operator!=(
        const sub_match<BidIt>& left,
        const sub_match<BidIt>& right);
 template<class BidIt>
    bool operator<(
        const sub_match<BidIt>& left,
        const sub_match<BidIt>& right);
 template<class BidIt>
    bool operator<=(
        const sub_match<BidIt>& left,
        const sub_match<BidIt>& right);
 template<class BidIt>
    bool operator>(
        const sub_match<BidIt>& left,
        const sub_match<BidIt>& right);
 template<class BidIt>
    bool operator>=(
        const sub_match<BidIt>& left,
        const sub_match<BidIt>& right);

 template<class BidIt, class IOtraits, class Alloc>
    bool operator==(
        const basic_string<typename iterator_traits<BidIt>::value_type, 
        IOtraits, Alloc>& left, const sub_match<BidIt>& right);
 template<class BidIt, class IOtraits, class Alloc>
    bool operator!=(
        const basic_string<typename iterator_traits<BidIt>::value_type, 
        IOtraits, Alloc>& left, const sub_match<BidIt>& right);
 template<class BidIt, class IOtraits, class Alloc>
    bool operator<(
        const basic_string<typename iterator_traits<BidIt>::value_type, 
        IOtraits, Alloc>& left, const sub_match<BidIt>& right);
 template<class BidIt, class IOtraits, class Alloc>
    bool operator<=(
        const basic_string<typename iterator_traits<BidIt>::value_type, 
        IOtraits, Alloc>& left, const sub_match<BidIt>& right);
 template<class BidIt, class IOtraits, class Alloc>
    bool operator>(
        const basic_string<typename iterator_traits<BidIt>::value_type, 
        IOtraits, Alloc>& left, const sub_match<BidIt>& right);
 template<class BidIt, class IOtraits, class Alloc>
    bool operator>=(
        const basic_string<typename iterator_traits<BidIt>::value_type, 
        IOtraits, Alloc>& left, const sub_match<BidIt>& right);

 template<class BidIt, class IOtraits, class Alloc>
    bool operator==(
        const sub_match<BidIt>& left,
        const basic_string<typename iterator_traits<BidIt>::value_type, 
        IOtraits, Alloc>& right);
 template<class BidIt, class IOtraits, class Alloc>
    bool operator!=(
        const sub_match<BidIt>& left,
        const basic_string<typename iterator_traits<BidIt>::value_type, 
        IOtraits, Alloc>& right);
 template<class BidIt, class IOtraits, class Alloc>
    bool operator<(
        const sub_match<BidIt>& left,
        const basic_string<typename iterator_traits<BidIt>::value_type, 
        IOtraits, Alloc>& right);
 template<class BidIt, class IOtraits, class Alloc>
    bool operator<=(
        const sub_match<BidIt>& left,
        const basic_string<typename iterator_traits<BidIt>::value_type, 
        IOtraits, Alloc>& right);
 template<class BidIt, class IOtraits, class Alloc>
    bool operator>(
        const sub_match<BidIt>& left,
        const basic_string<typename iterator_traits<BidIt>::value_type,
        IOtraits, Alloc>& right);
 template<class BidIt, class IOtraits, class Alloc>
    bool operator>=(
        const sub_match<BidIt>& left,
        const basic_string<typename iterator_traits<BidIt>::value_type, 
        IOtraits, Alloc>& right);

 template<class BidIt>
    bool operator==(
        const typename iterator_traits<BidIt>::value_type* left,
        const sub_match<BidIt>& right);
 template<class BidIt>
    bool operator!=(
        const typename iterator_traits<BidIt>::value_type* left,
        const sub_match<BidIt>& right);
 template<class BidIt>
    bool operator<(
        const typename iterator_traits<BidIt>::value_type* left,
        const sub_match<BidIt>& right);
 template<class BidIt>
    bool operator<=(
        const typename iterator_traits<BidIt>::value_type* left,
        const sub_match<BidIt>& right);
 template<class BidIt>
    bool operator>(
        const typename iterator_traits<BidIt>::value_type* left,
        const sub_match<BidIt>& right);
 template<class BidIt>
    bool operator>=(
        const typename iterator_traits<BidIt>::value_type* left,
        const sub_match<BidIt>& right);

 template<class BidIt>
    bool operator==(
        const sub_match<BidIt>& left,
        const typename iterator_traits<BidIt>::value_type*);
 template<class BidIt>
    bool operator!=(
        const sub_match<BidIt>& left,
        const typename iterator_traits<BidIt>::value_type*);
 template<class BidIt>
    bool operator<(
        const sub_match<BidIt>& left,
        const typename iterator_traits<BidIt>::value_type*);
 template<class BidIt>
    bool operator<=(
        const sub_match<BidIt>& left,
        const typename iterator_traits<BidIt>::value_type*);
 template<class BidIt>
    bool operator>(
        const sub_match<BidIt>&, left
        const typename iterator_traits<BidIt>::value_type*);
 template<class BidIt>
    bool operator>=(
        const sub_match<BidIt>& left,
        const typename iterator_traits<BidIt>::value_type*);

 template<class BidIt>
    bool operator==(
        const typename iterator_traits<BidIt>::value_type& left,
        const sub_match<BidIt>& right);
 template<class BidIt>
    bool operator!=(
        const typename iterator_traits<BidIt>::value_type& left,
        const sub_match<BidIt>& right);
 template<class BidIt>
    bool operator<(
        const typename iterator_traits<BidIt>::value_type& left,
        const sub_match<BidIt>& right);
 template<class BidIt>
    bool operator<=(
        const typename iterator_traits<BidIt>::value_type& left,
        const sub_match<BidIt>& right);
 template<class BidIt>
    bool operator>(
        const typename iterator_traits<BidIt>::value_type& left,
        const sub_match<BidIt>& right);
 template<class BidIt>
    bool operator>=(
        const typename iterator_traits<BidIt>::value_type& left,
        const sub_match<BidIt>& right);

 template<class BidIt>
    bool operator==(
        const sub_match<BidIt>& left,
        const typename iterator_traits<BidIt>::value_type& right);
 template<class BidIt>
    bool operator!=(
        const sub_match<BidIt>& left,
        const typename iterator_traits<BidIt>::value_type& right);
 template<class BidIt>
    bool operator<(
        const sub_match<BidIt>& left,
        const typename iterator_traits<BidIt>::value_type& right);
 template<class BidIt>
    bool operator<=(
        const sub_match<BidIt>& left,
        const typename iterator_traits<BidIt>::value_type& right);
 template<class BidIt>
    bool operator>(
        const sub_match<BidIt>& left,
        const typename iterator_traits<BidIt>::value_type& right);
 template<class BidIt>
    bool operator>=(
        const sub_match<BidIt>& left,
        const typename iterator_traits<BidIt>::value_type& right);
    }  // namespace tr1
}  // namespace std