C# conditional regex -
i new conditional regex , not sure how achieve below
input string - "test \n string \n\r"
output string - "test r string \n\r"
would replace \n 'r' , leave is, if \n\r
thanks, arthi
you can use negative lookbehind:
regex.replace(string, @"(?s)(?<!\r)\n", "r");
this replace \n
when not preceded \r