[Webkit-unassigned] [Bug 174044] New: RegExp's anchored with .* with \g flag can return wrong match start for strings with multiple matches

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jun 30 14:48:13 PDT 2017


https://bugs.webkit.org/show_bug.cgi?id=174044

            Bug ID: 174044
           Summary: RegExp's  anchored with .* with \g flag can return
                    wrong match start for strings with multiple matches
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: msaboff at apple.com

Consider the string:
    s = "\na\na\na\n";
along with the RegExp:
    r = new RegExp(".*\\s.*", "g");

The result of s.match(r) should be a match object with 4 entries, "\na", "\na", "\na" & "\n".
Instead we get "\na", "a\na", "a\na" & "a\n".

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170630/63b1bdb0/attachment.html>


More information about the webkit-unassigned mailing list