Compartilhar via


operator<< <regex>

Insere um sub_match em um fluxo.

template<class Elem, class IOtraits, class Alloc, class BidIt>
    basic_ostream<Elem, IOtraits>&
    operator<<(basic_ostream<Elem, IOtraits>& os,
        const sub_match<BidIt>& right);

Parâmetros

  • Elem
    o tipo de elemento.

  • IOtraits
    A classe dos traços de cadeia de caracteres.

  • Alloc
    A classe do distribuidor.

  • BidIt
    O tipo de iterador.

  • os
    o fluxo de saída.

  • right
    O objeto inserção.

Comentários

O operador retorna os << right.str()do modelo.

Exemplo

 

// std_tr1__regex__operator_ins.cpp 
// compile with: /EHsc 
#include <regex> 
#include <iostream> 
 
int main() 
    { 
    std::regex rx("c(a*)|(b)"); 
    std::cmatch mr; 
 
    std::regex_search("xcaaay", mr, rx); 
 
    std::csub_match sub = mr[0]; 
    std::cout << "whole match: " << sub << std::endl; 
 
    return (0); 
    } 
 
  

Requisitos

Cabeçalho: <regex>

namespace: STD

Consulte também

Referência

<regex>

sub_match Class