A Regular Expression to match a 2-digit number, which can be helpful in validating a Credit/Debit Card issue number.
/^[0-9]{2}$/g
Matches:
- 12
- 02
- 20
Non-matches:
- 123
- ab
- !@
See Also:
- Credit Card Number Regular Expressions
- Regular Expression To Validate Credit Card Expiration Date
- Regular Expression To Match Credit Card CVV Number