Author: rockinthesixstring | Posted on: 10/17/2008 1:03:47 PM | Views : 278

I am wondering if it is possible to have an incremental number regex.  What my scenerio is, is that I am asking the user to input the fiscal year of their business.  What needs to happen is that if they input "80" then the regex MUST look like "80-81" and not "80-43".  Is this possible with regex or do I need to program it into my ASP.NET page?

My current REGEX is as follows

(^((1[8-9]|[2-3]\d)\d{2})$|^((\d)(\d)-(\d)(\d))$)
1900 | 2008 | 80-81 | 90-32
1500 | 80 - 81 | 4000 | anytext
...

Go to the complete details ...