views:

54

answers:

4

In vs.net, I want to search for all occurances of

[someWord]

in my .sql file, and replace it with

[SomeWord]

Is this possible? (notice the uppercasing of the first character in the result)

A: 

If it's just a certain word:-

s/\[someWord\]/[SomeWord]/

But it might just be better to use a replace function

If it's anything in square brackets.

s/\[[a-zA-Z]+\]/[\u\1]/
Mez
it said argument is missing in \ escape sequence ? (using vs.net replace using regex)
mrblah
/me doesn't know vs.net well enough to give you something specific fo ti - I just know that's a valid PCRE.Which did you use?
Mez
A: 

Not sure but you might open that sql file externally is some editor like notepad++ and replace the stuff accordingly.

Sarfraz
A: 

Here, this is VS Addin for regex search and replace found on CodeProject. Be warned that the code was for VS 2003, but can be recompiled I'm sure for later versions of VS.NET.

Hope this helps, Best regards, Tom.

tommieb75
+2  A: 

Yes you can do Regex searches/Replaces in vs.net, just make sure to check the box in the dialog. The regex syntax is different from the Perl/.Net one though. Pay attention to the differences in syntax.

There's some reference here:

http://www.codinghorror.com/blog/archives/000633.html

Yann Schwartz