I'm using Visual Studio Code 1.14.2, and I'm trying to change name of variables to camelCase eg. set_nominal_wavelength
to setNominalWavelength
.
Regular expression: _([a-z])
Replace: \U$1\E
does not work. Any idea how to achieve it?
Command Palette: CTRL + SHIFT + p (Mac: CMD + SHIFT + p ) type >transform pick upper/lower case and press enter.
VSCode usage Vscode has a nice feature when using the search tool, it can search using regular expressions. You can click cmd+f (on a Mac, or ctrl+f on windows) to open the search tool, and then click cmd+option+r to enable regex search. Using this, you can find duplicate consecutive words easily in any document.
VSCode is using JavaScript-based regex engine, but it is not the same. You cannot use named capturing groups there. There is no specific documentation on the regex used in VSCode. However, if you have a look at the source code, you will see lots of JS code around.
There is a workaround:
_([a-z])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With