basically that's my question. Is it possible to find more than just one line in VS 2008? I would like to replace duplicate passages with a void function but sometimes there would be slight differences so it takes a lot of time to only find the same passages manually.
Asked
Active
Viewed 105 times
1 Answers
1
I don't understand your question correctly, so can you give an example what do you want to replace?
As far as I understand you want to replace strings matching specific rules. Well for that you can use regex, which is build into VS2008.

offlinehacker
- 842
- 1
- 9
- 14
-
for example a couple of if clauses written in several lines: if(a=b){...} if(c=d){...} if(a=b){...} etc and those lines occur several times in the same order along the whole project. I want to replace those by a single function so that the compiler has less work and compiling doesn't take so long. – user1331044 Aug 21 '12 at 21:41
-
But the Find What option in VS2008 only allows to enter only one line at a time (copy/ pasting several lines won't work). So is there an option to find (& replace) several lines at a time – user1331044 Aug 21 '12 at 21:49
-
I think [this](http://stackoverflow.com/questions/2273434/multiline-find-replace-in-visual-studio) should give an answer, there's also one written [macro](http://www.helixoft.com/blog/archives/15) for doing that and you can modify it for your needs ;) – offlinehacker Aug 21 '12 at 22:02
-
I've come across those links yesterday, too. However, there seems to be no Macro Explorer in my VS2008. Anyway, I've replaced the passages in question manually now. But Thx for help :-) – user1331044 Aug 22 '12 at 07:31