I have an Asp.net web form with an input field where people will enter the data in the format
Where N represents a number. And each set of numbers is seperated by a hyphen. Also two consecutive hyphens are not allowed. Also I need to prevent the applicaiton user from starting the number sequence with a hyphen or ending with a hyphen. So this is not allowed:
-NNNNN-NNN-NNNNN Nor -NNNNN-NNN-NNNNN- Nor -NNNN-NNN-NNNN-
Basically the rule is a first set of numbers followed by a hyphen, followed by another set of numbers, a hyphen and followed by third set of numbers. The total number of digits entered cannot exceed 20.
Can someone help me figure this out? I initially created this regular expression which I used to allow people to enter up to 20 numbers. The requirements have changed now so that I have to use hypens for input according to what I described earlier. This is what I initially had:
This is a difficult problem I have not been able to figure out. I will offer 400 points for some expert help.