How to change lower case to upper using regular expressions in Visual Studio Code

As of vscode v1.75 there is a Transform to Camel Case command. So you could

  1. Find: (_[a-z]+)+
  2. Alt+Enter will select all those
  3. trigger the Transform to Camel Case command

Pretty easy.


In the 1.47 Insiders Build support for the replace case modifiers (\L, \l, \U, \u) has been added to vscode. And so should be in the 1.47 stable release).

So simply doing your find: _([a-z])

and replace with \u$1 (since you only want to capitalize the first letter) works nicely in the Insiders Build now.

case modifier demo

Works in both the Find Widget and the Search Panel.

Leave a Comment