I have an enormous list of the following items:
_tags.Add(Foo.Bar,
new Baz(
...
));
_tagNames.Add("Bar",
_tags[Foo.Bar]);
where Bar and Baz(...) vary, and _tags, _tagNames and Foo stay the same.
I want to transform to
case "Bar":
_tags.Add(Foo.Bar,
new Baz(
...
));
_tagNames.Add("Bar",
_tags[Foo.Bar]);
break;
I am using Visual Studio, which supports regex.
Any ideas?
Thanks!
Update: VS couldn't handle 2300 instances of this regex. I got this working in Eclipse:
Search Pattern: _tags.Add((?:.|\R)*?_tags[Foo.(.*?)]);
Replace: case "\1":\n\0\n break;