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.
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!
If your string contains an optional group of characters at the start (e.g. “
”, where the second character could also match the following
) then try and use the start of string anchor “
” and a non capturing group (so our previous example becomes “
”). Oracle supply detailed information
about the Java regex engine that PaperCut
Having trouble seeing the applet in the Google Chrome browser? You may find help here.
Categories: Card Readers and User Identification
Keywords: card regex, change card number