12

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)

Sadegh
  • 4,181
  • 9
  • 45
  • 78
  • 1
    possible duplicate of [How do I convert strings in code to uppercase in visual studio?](http://stackoverflow.com/questions/1306377/how-do-i-convert-strings-in-code-to-uppercase-in-visual-studio) – Ahmad Mageed Nov 01 '10 at 19:55

5 Answers5

14

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.

JaredPar
  • 733,204
  • 149
  • 1,241
  • 1,454
4

For these kind of limitations in VS2010 I always keep GVim handy. Just paste the whole textfile in there, do whatever fancy thing is needed and then copy the results back. For search and replace using Vim see

http://vim.wikia.com/wiki/Changing_case_with_regular_expressions

I love VS2010 as an IDE, but some things this classic (free) editor can do are still unmatched.

Theo
  • 41
  • 1
1

Writing this as an answer instead of a comment to the accepted answer as my level is not high enough, but you dont really have to do all 27 instances, unless all you words start from a different letter. YOu can search for one letter at a time and say if it finds 10 instances that start with letter 's' you would replace it with 'S' so now u have 10 instances renamed :P

Evgeny Danilenko
  • 181
  • 2
  • 10
1

It is possible, see: https://www.regular-expressions.info/refreplacecase.html

search something like:

_([A-Z])([A-Za-z]+)

replace:

\u$1$2
logi-kal
  • 7,107
  • 6
  • 31
  • 43
Dennis
  • 11
  • 2
0

You could create a basic program to read the .vb or appropriate file line by line for the _ symbol and then use a for-next loop to check all the letters and make the required change.