Credit Card Regex

After searching the internet for a credit card regex pattern, I found a lot of roundabout answers and no clear cut regex pattern. I aim to change that! Here is a regex pattern you can use to match credit cards (disclaimer: it may not work 100% for you but after a few tweaks I am sure it will!)


If you have your own cool regex to share, post it in the comments! Hope this helps someone out there!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.