[re.submatch.op]

# 28 Text processing library [[text]](./#text)

## 28.6 Regular expressions library [[re]](re#submatch.op)

### 28.6.8 Class template sub_match [[re.submatch]](re.submatch#op)

#### 28.6.8.3 Non-member operators [re.submatch.op]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L10977)

Let *SM-CAT*(I) becompare_three_way_result_t<basic_string<typename iterator_traits<I>::value_type>>

[ð](#lib:sub_match,operator==)

`template<class BiIter>
  bool operator==(const sub_match<BiIter>& lhs, const sub_match<BiIter>& rhs);
`

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L10990)

*Returns*: lhs.compare(rhs) == 0[.](#2.sentence-1)

[ð](#lib:sub_match,operator%3c=%3e)

`template<class BiIter>
  auto operator<=>(const sub_match<BiIter>& lhs, const sub_match<BiIter>& rhs);
`

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L11002)

*Returns*: static_cast<*SM-CAT*(BiIter)>(lhs.compare(rhs) <=> 0)[.](#3.sentence-1)

[ð](#lib:operator==,sub_match_)

`template<class BiIter, class ST, class SA>
  bool operator==(
      const sub_match<BiIter>& lhs,
      const basic_string<typename iterator_traits<BiIter>::value_type, ST, SA>& rhs);
`

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L11016)

*Returns*: lhs.compare(typename sub_match<BiIter>::string_type(rhs.data(), rhs.size())) == 0

[ð](#lib:operator%3c=%3e,sub_match_)

`template<class BiIter, class ST, class SA>
  auto operator<=>(
      const sub_match<BiIter>& lhs,
      const basic_string<typename iterator_traits<BiIter>::value_type, ST, SA>& rhs);
`

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L11032)

*Returns*: static_cast<*SM-CAT*(BiIter)>(lhs.compare(typename sub_match<BiIter>::string_type(rhs.data(), rhs.size()))<=> 0)

[ð](#lib:sub_match,operator==__)

`template<class BiIter>
  bool operator==(const sub_match<BiIter>& lhs,
                  const typename iterator_traits<BiIter>::value_type* rhs);
`

[6](#6)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L11050)

*Returns*: lhs.compare(rhs) == 0[.](#6.sentence-1)

[ð](#lib:sub_match,operator%3c=%3e__)

`template<class BiIter>
  auto operator<=>(const sub_match<BiIter>& lhs,
                   const typename iterator_traits<BiIter>::value_type* rhs);
`

[7](#7)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L11063)

*Returns*: static_cast<*SM-CAT*(BiIter)>(lhs.compare(rhs) <=> 0)[.](#7.sentence-1)

[ð](#lib:sub_match,operator==___)

`template<class BiIter>
  bool operator==(const sub_match<BiIter>& lhs,
                  const typename iterator_traits<BiIter>::value_type& rhs);
`

[8](#8)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L11076)

*Returns*: lhs.compare(typename sub_match<BiIter>​::​string_type(1, rhs)) == 0[.](#8.sentence-1)

[ð](#lib:sub_match,operator%3c=%3e___)

`template<class BiIter>
  auto operator<=>(const sub_match<BiIter>& lhs,
                   const typename iterator_traits<BiIter>::value_type& rhs);
`

[9](#9)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L11089)

*Returns*: static_cast<*SM-CAT*(BiIter)>(lhs.compare(typename sub_match<BiIter>::string_type(1, rhs))<=> 0)

[ð](#lib:basic_ostream)

`template<class charT, class ST, class BiIter>
  basic_ostream<charT, ST>&
    operator<<(basic_ostream<charT, ST>& os, const sub_match<BiIter>& m);
`

[10](#10)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L11108)

*Returns*: os << m.str()[.](#10.sentence-1)
