LibRegex: Fix greedy \w and \W ignore-case handling

Keep the greedy built-in class fast path aligned with the regular VM
matcher for non-Unicode regexps. Without this, /\w+/i and /\W+/i
wrongly applied Unicode ignore-case behavior in the optimized loop.
This commit is contained in:
Andreas Kling
2026-03-25 22:19:05 +01:00
committed by Ali Mohammad Pur
parent 4b5f1a9a98
commit a03d1f8a5f
Notes: github-actions[bot] 2026-03-27 16:33:56 +00:00
2 changed files with 7 additions and 2 deletions

View File

@@ -2844,9 +2844,8 @@ impl<'a, I: Input> Vm<'a, I> {
}
}
SimpleMatch::BuiltinClass(class) => {
let uic = modifiers.ignore_case; // unicode_ignore_case for non-unicode is always false
while *pos < len && count < limit {
if !match_builtin_class(input.code_unit(*pos) as u32, *class, uic) {
if !match_builtin_class(input.code_unit(*pos) as u32, *class, false) {
break;
}
*pos += 1;