Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Visual Studio Find and Replace to convert upper-case char to lower-case with Regex

Here are my Find What reg-ex which matches all of those I'm going to grab.

<{_}{[A-Z\s+]}{[a-z0-9]*}>

Like _ColumnId, Now how to convert upper-case char after _ to lower-case equivalent? (_columnId)

like image 871
Sadegh Avatar asked Nov 01 '10 19:11

Sadegh


1 Answers

Unfortunately this is not possible to do in a general way. Matching the pattern is fairly straight forward as you an do with roughly the following

_{[A-Z]}

Then the expression \1 can be used to access the upper case letter. Unfortunately though there is no way in VS to say

Please replace with a lower case version of this expression

This puts you up against a wall. The only option is to do a search and replace for each of the 26 letters. Very labor intensize and not fun at all.

like image 143
JaredPar Avatar answered Sep 22 '22 00:09

JaredPar