Trying to use Visual Studio IDE (Find & Replace) as quick and dirty regex tool but got stuck

I have an xml text file open in the VS2005 IDE.

It has 4 highlighted lines:

<mc id="dog" name="mydogBob"/>
<mc id="cat" name="katie"/>
<mc id="turtle" name="slow"/>
<mc id="fish" name="happy"/>

      

How to use VS2005 Find / Replace function with regex to replace words and make the final result like this:

dog
cat
turtle
fish

      

Thank you very much

-Simon

0


source to share


1 answer


Find what:

^.*id="{.*}" .*$

      

Replace with:



\1

      

In the Search Options box, select Use and select Regular Expressions from the drop-down menu.

+5


source







All Articles