std::match_results<BidirIt,Alloc>:: size
From cppreference.net
<
cpp
|
regex
|
match results
|
size_type size
(
)
const
noexcept
;
|
(C++11부터) | |
서브매치의 개수를 반환합니다. 즉, std:: distance ( begin ( ) , end ( ) ) .
성공적인 매치 결과를 나타내지 않는 경우 0 을 반환합니다. * this 가
목차 |
매개변수
(없음)
반환값
부분 일치의 수.
복잡도
상수.
예제
이 코드 실행
#include <iostream> #include <regex> #include <string> int main() { std::regex re("a(a)*b"); std::string target("aaab"); std::smatch sm; std::cout << sm.size() << '\n'; std::regex_match(target, sm, re); std::cout << sm.size() << '\n'; }
출력:
0 2
참고 항목
|
서브 매치 목록의 시작을 가리키는 반복자를 반환합니다
(public member function) |
|
|
서브 매치 목록의 끝을 가리키는 반복자를 반환합니다
(public member function) |