std::match_results<BidirIt,Alloc>:: prefix
From cppreference.net
<
cpp
|
regex
|
match results
C++
Text processing library
| Localization library | |||||||||||||||||||||||||
| Regular expressions library (C++11) | |||||||||||||||||||||||||
| Formatting library (C++20) | |||||||||||||||||||||||||
| Null-terminated sequence utilities | |||||||||||||||||||||||||
| Byte strings | |||||||||||||||||||||||||
| Multibyte strings | |||||||||||||||||||||||||
| Wide strings | |||||||||||||||||||||||||
| Primitive numeric conversions | |||||||||||||||||||||||||
|
|||||||||||||||||||||||||
| Text encoding identifications | |||||||||||||||||||||||||
|
|||||||||||||||||||||||||
Regular expressions library
| Classes | ||||
|
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
||||
| Algorithms | ||||
|
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
||||
| Iterators | ||||
|
(C++11)
|
||||
|
(C++11)
|
||||
| Exceptions | ||||
|
(C++11)
|
||||
| Traits | ||||
|
(C++11)
|
||||
| Constants | ||||
|
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
||||
| Regex Grammar | ||||
|
(C++11)
|
std::match_results
| Member functions | ||||
| State | ||||
| Element access | ||||
|
match_results::prefix
|
||||
| Iterators | ||||
| Format | ||||
| Modifiers | ||||
| Non-member functions | ||||
|
(until C++20)
|
||||
|
const_reference prefix
(
)
const
;
|
(C++11부터) | |
정규 표현식의 전체 일치 시작 부분과 대상 시퀀스 시작 부분 사이의 대상 시퀀스를 나타내는 std::sub_match 객체에 대한 참조를 얻습니다.
ready()
는
true
여야 합니다. 그렇지 않으면 동작은 정의되지 않습니다.
반환값
일치하지 않는 접두사에 대한 참조입니다.
예제
이 코드 실행
#include <iostream> #include <regex> #include <string> int main() { std::regex re("a(a)*b"); std::string target("baaaby"); std::smatch sm; std::regex_search(target, sm, re); std::cout << sm.prefix().str() << '\n'; }
출력:
b
참고 항목
|
전체 매치의 끝과 대상 시퀀스의 끝 사이의 부분 시퀀스를 반환합니다
(public member function) |