4
I need to create a regular expression (Regex) that can identify the card number even when there are specific characters between the numbers,
Example:
Current regex: ((\d{16}|\d{4}(.\d{4}){3})|(\d{4}(\d{4}){3}))
Allowing me to read the number of cards when placed as follows:
4012001037141112
4012 0010 3714 1112
4012/0010/3714/1112
4012.0010.3714.1112
4012*0010*3714*1112
But I need to create a regex that identifies the card number, without looking at which field the specific character is typed, some examples of how the card number could appear and which regex above does not identify:
4/0/1/2/0/0/1/0/3/7/1/4/1/1/1/2
4.0.1.2.0.0.1.0.3.7.1.4.1.1.1.2
4.0.12001037141112
401200103714/1112
401*200103714111*2
The regex I have today works only when the character is typed after the 4 house, I want it to have the same action regardless of where the specific character is.
Could someone help me? These settings will use on DLP, me I don’t have access to the programming part only to a field where I put the regular expression.
Sanitize the string to only have numbers and validate normally. What you’re aiming for has no logical sense.
– Daniel Omine
Regular expression to detect credit card flag
– rray
In what language do you want to do this? Take a look here: http://answall.com/a/94489/129
– Sergio
Daniel I already have these regular expressions configured in my tool, but if there is a user a little smarter he can circumvent the tool, because those expressions you pass only take the information if the card number is typed with no character between the numbers, and how we work to maintain the security of the information , if we do not create one in this way, we will have leakage of many credit card numbers in the company, I am trying to funnel as much as possible my filter..
– Marcus Souza