Over a million developers have joined DZone.

Java Regular Expressions to Validate Credit Cards

DZone's Guide to

Java Regular Expressions to Validate Credit Cards

· Java Zone ·
Free Resource

Bring content to any platform with the open-source BloomReach CMS. Try for free.

Visa Card


Amex Card


Carte Blanche Card


Diners Club Card


Discover Card


JCB Card


Visa Master Card


Insta Payment Card


Laser Card


Maestro Card


Solo Card


Switch Card


Union Pay Card






As you can see, regular expressions are incredibly powerful and the above examples are very basic. Regular expressions are essential for all sorts of application from web scraping, form validation and pattern matching.

Hopefully you will find this resource useful and would come back to refer again and again.

BloomReach CMS: the API-first CMS of the future. Open-source & enterprise-grade. - As a Java developer, you will feel at home using Maven builds and your favorite IDE (e.g. Eclipse or IntelliJ) and continuous integration server (e.g. Jenkins). Manage your Java objects using Spring Framework, write your templates in JSP or Freemarker. Try for free.


Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}