Home » Main » Regular Expressions for Card Numbers

Regular Expressions for Card Numbers

Regular expressions (regexes) are used in several places in PaperCut, including with card numbers. Regexes are applied to card data to extract a useful card number. The raw data read from a card may contain multiple numbers (of which just one is required), extra information like a "site code" or "checksum", or additional characters designed as special markers or to separate multiple fields.

There are many different card formats out there so there is no "one size fits all". Rather, an appropriate regex should be used to extract the useful number for PaperCut to use.

The tool below can help to choose a suitable regex. See below for usage help.

Please install Java to use the card regex helper.

Recommended usage

1. Look at list of included examples to see if any match your need.
2. Obtain a test card number. E.g. plug a card reader into a computer, open a text editor and swipe the card. Copy the test card number into the "Card Number" field.
3. Enter a regex that results in the match you expect.
4. Try the same regex with a few more card numbers to make sure it's working how you expect.
5. Copy the regex, store it for safe keeping, use it in PaperCut!

Categories:


Keywords: card regex, change card number

Page last modified on February 06, 2012, at 08:24 PM

Comments

Share your findings and experience with other PaperCut users. Feel free to add comments and suggestions about this Knowledge Base article. Please don't use this for support requests.