stephen-riley / regexworkbench

A Visual Studio Code extension that allows one to easily play with regular expressions
15 stars 8 forks source link

UPPERCASE and lowersace on group not working? #7

Closed Puliczek closed 4 years ago

Puliczek commented 4 years ago

How to get it works?

Regex: ID_OSOB_([A-Z_a-złóźżćęą]+)

Replace ID_OSOB_${\U1}(""), - not working ID_OSOB_${\u1}(""), - not working ID_OSOB_$\U{1}(""), - not working ID_OSOB_\U${1}(""), - not working ID_OSOB_${1:\U}(""), - not working ID_OSOB_${1:+\U}(""), - not working

Search Text: ID_OSOB_Bułgaria

Replaced Text SHOULD BE: ID_OSOB_BUŁGARIA(""),

However replaced Text is NULL (invalid regular expression) or ID_OSOB_Bułgaria(""),

stephen-riley commented 4 years ago

Ah, good catch, thank you! I was not using the PCRE2_SUBSTITUTE_EXTENDED option when calling pcre2_substitute(). I will fix this in pcre2-wasm and update this project.

stephen-riley commented 4 years ago

Okay, fixed in 2.0.4, published to the Marketplace. Please update to latest version.

The syntax you'll want to use is ID_OSOB_\U${1}(""),, as shown in the attached picture.

image

Thanks for using the extension!