firasdib / Regex101

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

Please support regex capture group names named in Chinese #2276

Open BlackCleaverLoli opened 1 month ago

BlackCleaverLoli commented 1 month ago

Bug Description

When using Chinese characters as capture group names, the "?" in them will be incorrectly recognized as a quantifier.

Reproduction steps

Name a capture group using Chinese characters, such as (?<汉字>123)

Expected Outcome

"汉字" in the previous text should be considered as the capture group name and match "123".

Browser

Include browser name and version Microsoft Edge 124.0.2478.97

OS

Include OS name and version Windows 10 22H2

Unknownuserfrommars commented 1 month ago

Well yes, i tried reproducing your code by adding a P, as in (?P<汉字>123), but it didn't work. When i tried to replace 汉字 as hanzi: (?P<hanzi>123), it worked fine.

Also, the named capture group won't work for any Chinese characters, like 玩家 or 厉害

Hope you can fix this problem.

Browser: Chrome 123.0.6312.106 (64 bit) OS: Windows 11 23H2

Unknownuserfrommars commented 1 month ago

image