Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97355

Vs Code Perform Regex On Capture Group Result

$
0
0

I've got this samplestring:

registerForm.main.myApplicant = value

I need to replace this with:

registerForm.main.getMyApplicant() = value

The regex I've come up with is:

\w+\.\w+\.(\w)(\w+)

Where $1 equals the m that needs to be transformed into uppercase. And $2 equals the rest of the word that needs to have () appended.

When I do:

FIND:    \w+\.\w+\.(\w)(\w+)
REPLACE: get\u$1$2()

It just prints out \u instead of making it uppercase. How can I perform regex on the capture group $1?

I've also tried $1=\u$1

Here's a regexr demo


Viewing all articles
Browse latest Browse all 97355

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>