Reputation: 11578
I'm trying to create a
<asp:regularexpressionvalidator>
with following conditions:
Eg:
by the way, anyone knows a good regex online creator? Thanks
RESOLVED: For the first answer view the accepted answer, for the second view the first comment of this post by Jeff Turner
Upvotes: 0
Views: 446
Reputation: 39274
For the validator, this will work: [A-Z0-9]{8}
. For a plain Regex match, you would need to specify that that should match the whole string, like ^[A-Z0-9]{8}$
, but the regex validator already has an extra rule that the whole string must be matched instead of just a part.
Explanation:
[A-Z0-9]
will match any capital letter (A .. Z) and any digit (0 .. 9){8}
repeat the previous exactly 8 timesUpvotes: 3