dash icon indicating copy to clipboard operation
dash copied to clipboard

Regex matching should backtrack

Open y21 opened this issue 1 year ago • 0 comments

console.log(/.+a/.test('bba'));

This should return true, but currently returns false, because .+ eagerly consumes the whole string. Instead it should work its way backwards and realize that .+ should only match bb.

y21 avatar Jan 05 '24 10:01 y21