Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 7
Report Inappropriate Content
Message 1 of 3

Creating RegEx to monitor 13 digit numbers

Good day,

We have DLP 10.0.100 and we would like to create a RegEx to monitor South African ID numbers. I found the below RegEx from the internet ,its working but it also picks up software licence numbers and Serial Numbers.

(((\d{2}((0[13578]|1[02])(0[1-9]|[12]\d|3[01])|(0[13456789]|1[012])(0[1-9]|[12]\d|30)|02(0[1-9]|1\d|2[0-8])))|([02468][048]|[13579][26])0229))(( |-)(\d{4})( |-)(\d{3})|(\d{7}))

South African Id number consists of 13 digits so we want the RegEx to monitor 13 digits and if the number has more than 13 digits it shouldn't be considered as an ID number.

If there's anyone who knows how to create RegEx, your assistance will be appreciated.


2 Replies
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 2 of 3

Re: Creating RegEx to monitor 13 digit numbers

You will need to configure the Advanced Pattern Definition to use a Validator. Because the South Africa ID uses Luhn, the Luhn10 validator should work.

I tested with your RegEx and a sample ID and was successful in blocking and then tested using a generic number the rule was not triggered.

Level 7
Report Inappropriate Content
Message 3 of 3

Re: Creating RegEx to monitor 13 digit numbers

Hi Eyal,

Just want to check if you have done this?

I also need to apply regex SA ID No. and looking for similar information.

Thanks / Bhupesh.

You Deserve an Award
Don't forget, when your helpful posts earn a kudos or get accepted as a solution you can unlock perks and badges. Those aren't the only badges, either. How many can you collect? Click here to learn more.

Community Help Hub

    New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

  • Find Forum FAQs
  • Learn How to Earn Badges
  • Ask for Help
Go to Community Help

Join the Community

    Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

  • Get helpful solutions from McAfee experts.
  • Stay connected to product conversations that matter to you.
  • Participate in product groups led by McAfee employees.
Join the Community
Join the Community