I'm currently using :s/(-[a-z].*-)([a-z])/$1\U$2/.
, however this just deletes the character after the 2nd -
instead of converting it to an uppercase variant?
I have a CSS file and I have several entries in the form of,
ql-font-timesnewroman
, ql-font-arial
, ql-font-geneva
, etc.
I want to convert them to ql-font-Timesnewroman
, ql-font-Arial
, ql-font-Geneva
, etc.
I am using VSVim with VSCode, and I am not sure which version of Regex it uses (but I believe it is the Javascript variant).
If I use the PHP variant, it works fine. (https://regex101.com/r/8aZI2m/1)
But if I use the Javascript variant, it just sticks a U
into the result: ql-font-Utimesnewroman
.
In VSCode, it goes a step further and just inserts \U
instead. (ql-font-\Utimesnewroman
).
If I change the regex to look more like, :s/(-[a-z].*-)([a-z])/$1/\U$2/.
, it just goes ahead and erases the 2nd match instead of converting it to uppercase (ql-font-imesnewroman
)
Is there any special syntax that VSVim / VSCode needs for its regex to match and replace with an uppercase correctly?