mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 06:53:45 +00:00
ICU-20544 Regex, fix min/max match length computation with negative look-behind patterns.
This commit is contained in:
parent
6daab85db4
commit
7053363323
2 changed files with 6 additions and 3 deletions
|
@ -2328,7 +2328,7 @@ void RegexCompile::handleCloseParen() {
|
|||
error(U_REGEX_LOOK_BEHIND_LIMIT);
|
||||
break;
|
||||
}
|
||||
if (minML == INT32_MAX && maxML == 0) {
|
||||
if (minML == INT32_MAX) {
|
||||
// This condition happens when no match is possible, such as with a
|
||||
// [set] expression containing no elements.
|
||||
// In principle, the generated code to evaluate the expression could be deleted,
|
||||
|
|
7
icu4c/source/test/testdata/regextst.txt
vendored
7
icu4c/source/test/testdata/regextst.txt
vendored
|
@ -1439,13 +1439,16 @@
|
|||
"[^\u0000-\U0010ffff]" "a"
|
||||
"[^[^\u0000-\U0010ffff]]" "<0>a</0>"
|
||||
|
||||
# Bug ICU-20544. Similar to 20385, above. Assertion failure with a negative look-behind assertion containing
|
||||
# a set with no contents. Look-behind pattern includes more than just the empty set.
|
||||
|
||||
"(?<![ⰿ&&m]c)" "<0></0>abc" # note: first 'ⰿ' is \u2c3f, hence empty set.
|
||||
"(?<![^\u0000-\U0010ffff]c)" "<0></0>abc"
|
||||
|
||||
# Random debugging, Temporary
|
||||
#
|
||||
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Regexps from http://www.regexlib.com
|
||||
#
|
||||
|
|
Loading…
Add table
Reference in a new issue