By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,665 Members | 1,912 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,665 IT Pros & Developers. It's quick & easy.

Visual Studio Find & Replace Question??

P: n/a

VS2005

In the find/replace dialog if I make a regex like this I can find all
of the "New" statements that instantiate a class with "System" in the
name:

<New>.*<System>

But how - in the VS find/replace dialog - can I negate the "System"
portion of the search? How do I say: find all lines with "New" that
do NOT have the word "System" after "New"??

Any help would be appreciated...
Jun 27 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a


"Crash" <so*********@san.rr.comwrote in message
news:5f**********************************@d77g2000 hsb.googlegroups.com...
>
VS2005

In the find/replace dialog if I make a regex like this I can find all
of the "New" statements that instantiate a class with "System" in the
name:

<New>.*<System>

But how - in the VS find/replace dialog - can I negate the "System"
portion of the search? How do I say: find all lines with "New" that
do NOT have the word "System" after "New"??

Any help would be appreciated...
Try the following:

<New>:b+<~(System).*>

I replaced your .* between Newand <System so it only matches whitespace
(tabs and/or spaces) in between.....change it back if that's not what you
want :)

HTH,
Mythran
Jun 27 '08 #2

P: n/a

"Crash" <so*********@san.rr.comwrote in message
news:5f**********************************@d77g2000 hsb.googlegroups.com...
>
VS2005

In the find/replace dialog if I make a regex like this I can find all
of the "New" statements that instantiate a class with "System" in the
name:

<New>.*<System>

But how - in the VS find/replace dialog - can I negate the "System"
portion of the search? How do I say: find all lines with "New" that
do NOT have the word "System" after "New"??

Any help would be appreciated...
You can write a solution that does this as an add in to the VS IDE. When you
publish it, let me know.

It had better work. <smile>

Jun 27 '08 #3

P: n/a


"Mythran" <My*****@community.nospamwrote in message
news:16**********************************@microsof t.com...
>

"Crash" <so*********@san.rr.comwrote in message
news:5f**********************************@d77g2000 hsb.googlegroups.com...
>>
VS2005

In the find/replace dialog if I make a regex like this I can find all
of the "New" statements that instantiate a class with "System" in the
name:

<New>.*<System>

But how - in the VS find/replace dialog - can I negate the "System"
portion of the search? How do I say: find all lines with "New" that
do NOT have the word "System" after "New"??

Any help would be appreciated...

Try the following:

<New>:b+<~(System).*>

I replaced your .* between Newand <System so it only matches whitespace
(tabs and/or spaces) in between.....change it back if that's not what you
want :)

HTH,
Mythran

You can also replace the (System).* with (System).@ to get only the word
portion and not the entire string (IE:

Dim I As New IO.Stream

The first post I made would capture "New IO.Stream" while the new way I
posted would capture "New IO"

HTH,
Mythran
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.