unicode : simplify
This commit is contained in:
parent
e972e6cbf8
commit
ee6d1b3fb4
1 changed files with 15 additions and 18 deletions
11
unicode.cpp
11
unicode.cpp
|
@ -620,10 +620,10 @@ std::vector<std::string> unicode_regex_split(const std::string & text, const std
|
|||
continue;
|
||||
}
|
||||
|
||||
if (regex_expr[i] == '\\' && i + 1 < regex_expr.size()) {
|
||||
if (regex_expr[i + 1] == 'p') {
|
||||
if (i + 3 < regex_expr.size() && regex_expr[i + 2] == '{') {
|
||||
if (regex_expr[i + 4] == '}') {
|
||||
if (regex_expr[i + 0] == '\\' && i + 4 < regex_expr.size() &&
|
||||
regex_expr[i + 1] == 'p' &&
|
||||
regex_expr[i + 2] == '{' &&
|
||||
regex_expr[i + 4] == '}') {
|
||||
const std::string pat = regex_expr.substr(i, 5);
|
||||
if (k_ucat_enum.find(pat) != k_ucat_enum.end()) {
|
||||
if (!inside) {
|
||||
|
@ -638,9 +638,6 @@ std::vector<std::string> unicode_regex_split(const std::string & text, const std
|
|||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
regex_expr_collapsed += regex_expr[i];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue