firasdib / Regex101

This repository is currently only used for issue tracking for www.regex101.com
3.26k stars 199 forks source link

Unicode group \p{Zs} description is not correct #2194

Closed six5536 closed 9 months ago

six5536 commented 9 months ago

Bug Description

Unicode group \p{Zs} description is not correct

Reproduction steps

Use regex: [\p{Zs}] Flavour: JavaScript, Flags: gu

Expected Outcome

A description something like: \p{Zs} matches a space character (of various non-zero widths)

Actual Outcome

The following group description \p{Zs} matches a whitespace character that is invisible, but does take up space

Browser

Chrome 120.0.6099.109 (Official Build) (x86_64)

OS

MacOS 14.1.2 (23B92)

working-name commented 9 months ago

Hi @zx-ncoderz,

I'm afraid I don't quite see the difference other than a narrower definition from whitespace to space. The rest of it is semantics that don't change the underlying meaning. Would you like to expand further?

Also, I'm not sure if 120 implemented it but the regex engine in Chromium 119 doesn't know about \p{Zs}

image
six5536 commented 9 months ago

@working-name You are right, I somehow mis-read the original text. Thanks for the heads up regarding support in Chrome. I'll close the issue.