I'm using the Find / Replace tool of visual studio to find something using regular expressions and make a replace. I have this in the find: Assert.IsTrue\(([^,;]*)\) *; and the replace Assert.IsTrue($1, "$1");, so what this does is looking for every Assert.IsTrue(); whith anything in the parentheses except for commas , and semicolons ;, and then add whatever was on the parentheses inside quotes and after a comma ,. So, if I have Assert.IsTrue(wtv) it will be replaced with Assert.IsTrue(wtv,"wtv").
The problem is when the wtv has quotes or break lines, so if I have
Assert.IsTrue("wtv" == "wtv") it will be replaced to
Assert.IsTrue("wtv" == "wtv", ""wtv" == "wtv"") and
Assert.IsTrue(wtv ||
wtv2)
will be replaced to
Assert.IsTrue(wtv ||
wtv2, "wtv ||
wtv2")
. What I want to do is eliminate in the replacement the new line \r and the quotes, so the results after the replacement are
Assert.IsTrue("wtv" == "wtv", "wtv == wtv") and
Assert.IsTrue(wtv ||
wtv2, "wtv ||wtv2")