- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
06-27-2011 12:26 AM
Hi All,
Hope someone is able to help. I have no experience with regex
South African ID Number are a 13 digit number incorporating date of birth, gender, citizenship and there is a check digit at the end to vilidate the number.
I am looking for a way to vailidate these ID numbers.
For example my ID number is 7902275404184
The first 6 numbers are date of Birth YYMMDD
The 7th digit specifies gender 0-4 - Female 5-9 - Male
The next 3 digits (8-10) are sequence numbers and are anything from 000-999
The 11th digit is citizenship 0 - RSA Citizen, 1 - Non-Citizen
Digit 12 was used for race but this is now null and void so this would be anything from 0-9
And this is where things start to get interesting the last digit (13) is the valiidation check.
The web site below explains how this is checked against the preceding 12 digits
http://geekswithblogs.net/willemf/archive/2005/10/30/58561.aspx
Is regex able to do this type of validation?
I have found a couple of pre-built regex queries but none of them vailidate the ID number.
Regards
Marc
06-27-2011 01:17 PM
Marc,
The Paloaltonetworks firewalls do pattern matching but do not do REGEX Validation. If this is an important feature I would like to redirect you to your local SE so you can request a feature enhancement for future versions of the product.
Thanks,
Phil
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!