xxxxxxxxxx
using System.Text.RegularExpressions;
Regex.Replace("String containing pattern", "(con.*ern)+", match => match.Groups[0].Value.ToUpper()));
// "String CONTAINING PATTERN"
Regex.Replace("helo world", "(h)(.*?)(l)", "H$2$3$3")
// "Hello world"
new Regex("pattern").Replace("pattern pattern pattern", "replaced", 1)) // first occurance
// "replaced pattern pattern"
xxxxxxxxxx
Regex validateNumberRegex = new Regex("^(\\d+\\s{0,1})+$"); //1 2 6 5 8 9 6 3
Regex validateNumberRegex = new Regex("^\\d+$"); //65