Is there a way to do a replace in a string like this? (this is simplified example)
string input = "INSERT INTO blah VALUES \" blah blah \r\n \" \r\n (here can be anything like several new lines and \t tabs) INSERT INTO blah VALUES \" blah blah \r\n \" \r\n";
input.Replace("\r\n", "\n"); // this is just example, it doesn't work the way I need it
// and the output would look like this:
string output= "INSERT INTO blah VALUES \" blah blah \r\n \" \n INSERT INTO blah VALUES \" blah blah \r\n \" \n";
So it would replace new lines only outside the SQL commands? Can this be safely achieved using regular expressions?
EDIT: the replace must be probably realised with \r\n to \n there could be more of them between the SQL commands. The commands are not precisely separated.
EDIT: so the basic problem is - how do I replace in the outer string only?
string = "outer string \"inner string\" outer string \"inner string\" outer string"
input = input.Replace("\r\n", "\n");