[Test]
public void ShouldRemoveRegex()
{
const string stringWithListNumbers = "This is a #9: string with #10: list numbers.";
Assert.AreEqual("This is a string with list numbers.", stringWithListNumbers.RemoveRegex("#[0-9]*:"));
}
public static string RemoveRegex(this string arg, string pattern)
{
var tagRegex = new Regex(pattern);
return tagRegex.Replace(arg, string.Empty);
}