C++ regex_search()

1 개요[ | ]

C++ regex_search()
#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();
    }
}

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}