In C#, I write the following string to a string variable, carriage return and all:
asdfasdfasdf asdfas<test>asdfasdf asdfasdf<test>asdfasdf In Notepad2, I use this regular expression:
<test>.*<test> It selects this text as expected:
<test>asdfasdf asdfasdf<test> However, when I do this in C#:
System.Text.RegularExpressions.Regex.Replace(s, "<test>.*<test>", string.Empty); It doesn't remove the string. However, when I run this code on a string without any carriage returns, it does work.
So what I am looking for is a regex that will match ANY character, regardless whether or not it is a control code or a regular character.