regex c# only get all digitis code example Example: regex for numbers Regex regex = new Regex(@"^\d$");