regex for only 5 digit nubers code example Example 1: regex 10 numbers only @"^\d{10}$" Example 2: regex pater for only 4 or 6 digits ^([0-9]{4}|[0-9]{6})$