[AccessD] Search for credit card numbers

Michael Bahr jedi at charm.net
Fri Apr 18 11:32:17 CDT 2008


Hi Mark, your best solution is to use a regular expression to match a
pattern of numbers.  CC numbers can have dashes or spaces separating the
number groups or can be contiguous--just depends on how it was written. 
For example using a pattern like

(\d+((\ |-)?\d+)+)

Meaning:
1. The first set of parens (outer) capture the whole matching CC number.
2. The first \d+ means one or more digits
3. The ((\ |-)?\d+) means the next char either a space or "-" may exist
(because of the ?) and then again 1 or more digits
4. And the final + is one or more of the pattern in #3.

would cover 3 possible patterns
0000-0000-0000-0000
0000 0000 0000 0000
0000000000000000

CC number length range from 13 to 16 digits so this should catch them. 
however this is not foolproof.  If you happen to have some other number
that matches that pattern then it too will get caught.

If you want to determine the issuer then a simple case statement matching
the identifier will suffice.

Give this some thought.

Mike...


>
> Hello All,
>
> I'm getting ready to build something that searches MEMO and text fields
> for credit card numbers (card number NOT known)...and then replace them.
>
> Before I got started,  I was wondering if anyone has any advice...or has
> done somthing similar.
>
> Thanks,
>
> Mark A. Matte
> _________________________________________________________________
> Use video conversation to talk face-to-face with Windows Live Messenger.
> http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_video_042008
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>





More information about the AccessD mailing list