Regex for a Customer number
-
My Customer number is in the pattern : 88765 ie. 5 digits alone... using regex i have to validate if there are any characters and special characters in the customer number. Incase there are any characters (eg: 8AB90) or special characters then my string is invalid. Please help me with the RegEx for the same.
-
My Customer number is in the pattern : 88765 ie. 5 digits alone... using regex i have to validate if there are any characters and special characters in the customer number. Incase there are any characters (eg: 8AB90) or special characters then my string is invalid. Please help me with the RegEx for the same.
poornima sadasivan wrote:
validate if there are any characters and special characters in the customer number.
An easier way it to check to make sure all characters are numbers. This uses LINQ. For example:
return strVar.All(char.IsDigit);
-
My Customer number is in the pattern : 88765 ie. 5 digits alone... using regex i have to validate if there are any characters and special characters in the customer number. Incase there are any characters (eg: 8AB90) or special characters then my string is invalid. Please help me with the RegEx for the same.