Currently, I am struggling to define the regular expression needed for proper validation in my ASP.NET validator. Although it works fine in Firefox, the sample string is not validating correctly in IE using the following expression:
12{2}12{0-9}1{12,13}
I have researched and discovered that there may be a lookahead bug causing this issue. As someone new to regex, I need guidance on how to troubleshoot and modify the expression effectively?
I am eager to gain more knowledge in this area!
EDIT: The expression should match three optional individual components that can appear in any order within the string. I tried creating separate expressions for each component and then combining them into one.
{n} regex {\d+\} matches {423} with optional digits
{n,n,n} regex {(\d+,)+\d+\} matches sets like {24,25,26}
{n-n} regex {(\d+)\-(\d+)\} matches ranges like {0-9}
individual digits (\d) matches examples like 232
EDIT 2: Special thanks to woohoo, as I will use this final expression:
((\d*\#*\**)*\{((\d*\#*\**)+|(\d*\#*\**)+\-(\d*\#*\**)+|((\d*\#*\**)+\,)+(\d*\#*\**)+)\}(\d*\#*\**)*)+
This expression accommodates digits, #, and * at every position.