1: 2: 3: 4:
string pattern = "[^(0-9|;)]"; string replacement = string.Empty; Regex rgx = new Regex(pattern); string mycontroledContentfile = rgx.Replace(mycontentfile, replacement);