The following RegEx pattern is a quick regular expression to match and validate the Credit Card’s CVV numbers. These numbers are 3 or 4 digits found on the back of your credit cards and they ensure that you are the true owner of a card.
/^[0-9]{3,4}$/
Matches:
- 123
- 456
- 1234
Non-matches:
- 12
- abc
- 123b
See Also:
- Credit Card Number Regular Expressions
- Regular Expression To Validate Credit/Debit Card Issue Number (Two Digits)
- Regular Expression To Validate Credit Card Expiration Date