RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Egyptian National ID
Expression
(?<BirthMillennium>[23])\x20?(?:(?<BirthYear>[0-9]{2})\x20?(?:(?:(?<BirthMonth>0[13578]|1[02])\x20?(?<BirthDay>0[1-9]|[12][0-9]|3[01]))\x20?|(?:(?<BirthMonth>0[469]|11)\x20?(?<BirthDay>0[1-9]|[12][0-9]|30))\x20?|(?:(?<BirthMonth>02)\x20?(?<BirthDay>0[1-9]|1[0-9]|2[0-8]))\x20?)|(?:(?<BirthYear>04|08|[2468][048]|[13579][26]|(?<=3)00)\x20?(?<BirthMonth>02)\x20?(?<BirthDay>29)\x20?))(?<ProvinceCode>0[1-34]|[12][1-9]|3[1-5]|88)\x20?(?<RegistryDigit>[0-9]{3}(?<GenderDigit>[0-9]))\x20?(?<CheckDigit>[0-9])
Description
Matches the Egyptian National ID Number with captured named groups, optional spaces between codes and leap year support. (C# Flavor)
Matches
29502200502853 | 2 95 02 20 05 0285 3 | 3 00 02 29 01 0492 6
Non-Matches
3 01 02 29 01 0492 6 | 3 01 02 29 01 0492 | 3010229010492-6
Author Rating: Not yet rated. Amr Al Sayed
Source Amr Al Sayed
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Egyptian National ID Pattern for HTML and java script
Name: Ahmed Hany
Date: 7/19/2020 7:10:20 AM
Comment:
[23](?:[0-9]{2}(?:(?:(?:0[13578]|1[02])(?:0[1-9]|[12][0-9]|3[01]))|(?:(?:0[469]|11)(?:0[1-9]|[12][0-9]|30))|(?:02(?:0[1-9]|1[0-9]|2[0-8])))|(?:(?:04|08|[2468][048]|[13579][26]|(?<=3)00)0229))(?:0[1-4]|[12][1-9]|3[1-5]|88)[0-9]{4}[1-9]


Title: TestFindEgyptian National ID
Name: raed
Date: 8/4/2019 9:12:44 AM
Comment:
/(2|3)[0-9][0-9][0-1][0-9][0-3][0-9](01|02|03|04|11|12|13|14|15|16|17|18|19|21|22|23|24|25|26|27|28|29|31|32|33|34|35|88)\d\d\d\d\d/


Title: Great Work
Name: Eslam Sobhy
Date: 5/12/2018 2:39:00 PM
Comment:
work fine in c# but in client side with jquery not working please help me and thanks


Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials