C# regular expression to match ANY character?

You forgot to specify that the Regex operation (specifically, the . operator) should match all characters (not all characters except \n):

System.Text.RegularExpressions.Regex.Replace(s, "<test>.*<test>", string.Empty, RegexOptions.Singleline);

All you needed to add was RegexOptions.Singleline.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)