다음을 통해 공유


operator<< <regex>

Inserts a sub_match in a stream.

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

매개 변수

  • Elem
    요소 형식입니다.

  • IOtraits
    The string traits class.

  • Alloc
    The allocator class.

  • BidIt
    반복기의 형식입니다.

  • os
    출력 스트림입니다.

  • right
    삽입할 개체입니다.

설명

The template operator returns os << right.str().

예제

 

// 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); 
    } 
 
  

요구 사항

헤더:<regex>

네임스페이스: std

참고 항목

참조

<regex>

sub_match 클래스