1 개요[ | ]
- C++ regex_search()
C++
CPU
2.6s
MEM
171M
2.6s
Copy
#include <iostream>
#include <string>
#include <regex>
using namespace std;
int main() {
string s ("this subject has a submarine as a subsequence");
regex e ("\\b(sub)([^ ]*)");
smatch m;
while (regex_search (s,m,e)) {
cout << m[0] << " | " << m[1] << " | " << m[2] << endl;
s = m.suffix().str();
}
}
subject | sub | ject submarine | sub | marine subsequence | sub | sequence
2 같이 보기[ | ]
3 참고[ | ]
편집자 Jmnote
로그인하시면 댓글을 쓸 수 있습니다.