I have the following RegEx.Replace:
Regex.Replace(line[k], "(?i)(?<!^)(?<!;)\"(?![\";])", "\"\"", RegexOptions.None);
line[k] = a string from a string[]
What i want it to do is replace all quotation marks (") with double quotation marks ("") but only if the quotation mark is NOT the beginning of the string and not preceded or followed by a ; as example:
"This is a "sentence" that starts with a quotation mark";"This is another sentence with a "quotation" mark preceded by a ; "
should be:
"This is a ""sentence"" that starts with a quotation mark";"This is another sentence with a ""quotation"" mark preceded by a ; "
I pretty much copied the regular expression from a regex builder and it worked there after i worked on it, but now in my application it doesnt work anymore. I even tested the same string in the regex builder and my own application.