함수 preg_split_delim_capture()

1 개요[ | ]

함수 preg_split_delim_capture()

2 같이 보기[ | ]

3 C++[ | ]

#include <iostream>
#include <vector>
#include <regex>
using namespace std;

int main() {
    string s("aaa1bbb2ccc");
    regex r("([0-9])");
    vector<std::string> tokens(sregex_token_iterator(s.begin(), s.end(), r, {-1, 0}), sregex_token_iterator());
    for (string t: tokens) cout << t << ", "; // aaa, 1, bbb, 2, ccc, 
}

4 JavaScript[ | ]

console.log( 'aaa1bbb2ccc'.split(/([0-9])/) );

5 PHP[ | ]

$keywords = preg_split('/([0-9])/', 'aaa1bbb2ccc', -1, PREG_SPLIT_DELIM_CAPTURE);
print_r($keywords);
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}