I would like to remove telephone numbers from a string using C#. I have been experimenting using different variations of regex with little success.
I would like a solution that is quick to execute (sub 0.1s if possible) as it will be used extensively in a production environment.
This is the code that I have been testing.
var stringContainingPhoneNumber = "This is some random text, I would like £4.99 for this item, please call me on 07828123456 for further information.";
var numberReplace = new Regex(@"((\d){3}-1234567)|((\d){3}\-(\d){3}\-4567)|((\d){3}1234567)");
stringContainingPhoneNumber = numberReplace.Replace(stringContainingPhoneNumber, "[TELEPHONE REMOVED]");