RESOLVED CONFIGURATION CHANGED 272546
Incorrect regex replacement for \p{Emoji}
https://bugs.webkit.org/show_bug.cgi?id=272546
Summary Incorrect regex replacement for \p{Emoji}
ocavue
Reported 2024-04-11 13:29:59 PDT
I found a difference in regex behavior between Safari and Chrome/Firefox. Copy and paste the following code into devtools: ```js const s = "🍎".replace(/^[^\p{Emoji}]+|[^\p{Emoji}]+$/u, "") console.log(s) for (let i = 0; i < s.length; i++) { console.log(s.codePointAt(i)) } ``` Both Chrome and Firefox output the result below: ``` 🍎 127822 57166 ``` However Safari outputs: ``` 55356 ```
Attachments
rendering in safari, firefox, chrome (222.42 KB, image/png)
2024-04-11 18:31 PDT, Karl Dubost
no flags
My macOS and Safari version (1009.91 KB, image/png)
2024-04-11 23:00 PDT, ocavue
no flags
My macOS and Safari version (updated) (1.04 MB, image/png)
2024-04-11 23:12 PDT, ocavue
no flags
Karl Dubost
Comment 1 2024-04-11 18:31:31 PDT
Created attachment 470877 [details] rendering in safari, firefox, chrome Same results in Safari Technology Preview 192 19619.1.8.1 Firefox Nightly 126.0a1 12624.4.11 Google Chrome Canary 125.0.6413.0 6413.0
Karl Dubost
Comment 2 2024-04-11 18:32:02 PDT
ocavue, could you try in STP192? I can't reproduce this is working for me.
ocavue
Comment 3 2024-04-11 23:00:29 PDT
Created attachment 470883 [details] My macOS and Safari version Here is my current macOS and Safari version. I will update my STP to the latest version and try again.
ocavue
Comment 4 2024-04-11 23:12:17 PDT
Created attachment 470884 [details] My macOS and Safari version (updated) I can confirm that this issue doesn't occur anymore in the latest STP Release 192, as shown in my screenshot. So this is a fixed issue. Thanks for your helping and this ticket can be closed now.
Karl Dubost
Comment 5 2024-04-12 01:01:11 PDT
Thanks for replying quickly. <3
Note You need to log in before you can comment on or make changes to this bug.