agp
agp

Reputation: 363

How to perform a wild card search for a specific string using RegEx with a specfic character in the end

In the Visual Studio IDE, I am trying to locate all static fields, the plain search on "static" word also shows static properties and methods as well. How can I search for the field declarations while ignoring all method ones - static methods will end with ")"

So I guess, it's going to be a wild card search starting with "static" and not ending with ")".

Any help is appreciated.

Upvotes: 2

Views: 184

Answers (1)

John Sobolewski
John Sobolewski

Reputation: 4572

This will find static and not followed by )

static[^)]*$

This will find anything with static but the line not ending in ) with optional trailing white space.

static.*[^(]\s*$

Will work however it will still find things that are commented out.

If you do ctrl+shift+f before you try to search you will get a nice listing of everything found. Make sure to check "USE" then regular expression

Upvotes: 2

Related Questions