[Webkit-unassigned] [Bug 272546] New: Incorrect regex replacement for \p{Emoji}

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 11 13:29:59 PDT 2024


            Bug ID: 272546
           Summary: Incorrect regex replacement for \p{Emoji}
           Product: WebKit
           Version: Safari 17
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ocavue at gmail.com

I found a difference in regex behavior between Safari and Chrome/Firefox.

Copy and paste the following code into devtools:

const s = "��".replace(/^[^\p{Emoji}]+|[^\p{Emoji}]+$/u, "")
for (let i = 0; i < s.length; i++) {

Both Chrome and Firefox output the result below:


However Safari outputs:



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/20240411/bf06982a/attachment.htm>

More information about the webkit-unassigned mailing list