Actions
Bug #22494
openRegexp search misses a match when an assertion precedes a leading .*
Bug #22494:
Regexp search misses a match when an assertion precedes a leading .*
Description
When a regexp starts with an assertion (^, \b, (?=...), (?!...)) followed by .*, the search only tries the start position and misses later matches.
"aab".index(/(?!a).*b/m) #=> nil (expected: 2)
"ab\ncb".index(/^.*b/m, 1) #=> nil (expected: 3)
"aaaa bx".index(/\b.*x/, 1) #=> nil (expected: 4)
@make_now_just (Hiroya Fujinami) found this and wrote the fix.
Actions