Regular Expressions for Card Numbers
KB Home | 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.
Recommended usage
Handy tip
;?0?(\d{8})
”, where the second character could also match the following \d
) then try and use the start of string anchor “^
” and a non capturing group (so our previous example becomes “^(?:;0)?(\d{8})
”). Oracle supply detailed information about the Java regex engine that PaperCut uses.
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
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.
Article last modified on July 12, 2018, at 12:02 AM
Printable View | Article History | Edit Article