Regex101 icon indicating copy to clipboard operation
Regex101 copied to clipboard

Please support regex capture group names named in Chinese

Open BlackCleaverLoli opened this issue 1 year ago • 2 comments

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

BlackCleaverLoli avatar May 12 '24 23:05 BlackCleaverLoli

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 avatar May 13 '24 15:05 Unknownuserfrommars

image

Unknownuserfrommars avatar May 13 '24 15:05 Unknownuserfrommars

Dup of https://github.com/firasdib/Regex101/issues/1738

firasdib avatar Sep 21 '24 11:09 firasdib