mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
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:
committed by
Ali Mohammad Pur
parent
4b5f1a9a98
commit
a03d1f8a5f
Notes:
github-actions[bot]
2026-03-27 16:33:56 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/a03d1f8a5f9 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8612 Reviewed-by: https://github.com/jdahlin Reviewed-by: https://github.com/trflynn89
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user