André C. Andersen
André C. Andersen

Reputation: 9385

To lower case using Find and Replace with regular expression in Visual Studio 2010

I am using the Find and Replace function in Visual Studio 2010 in order to change the coding style for fields.

All instances similar to

m_MyField

should be

_myField

but I can only manage to get

_MyField

using

Find what:      m_{[a-zA-Z]}
Replace with:   _\1

How do I make the first letter lower case? I have tried the following but it does not work:

Find what:      m_{[a-zA-Z]}
Replace with:   _\L\1

I found this explained in http://vim.wikia.com/wiki/Changing_case_with_regular_expressions but it only works for vim I think.

Any suggestions are welcomed.

Upvotes: 3

Views: 2070

Answers (1)

Jürgen Steinblock
Jürgen Steinblock

Reputation: 31723

I would use this approach:

Find what:      m_A{[a-zA-Z]}
Replace with:   _a\1

and repeat it for B..Z

Not elegant but should be done quick.

Upvotes: 1

Related Questions