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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Mexican CURP RegEx
Expression
^[a-zA-Z]{4}((\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)(H|M)(AS|BC|BS|CC|CL|CM|CS|CH|DF|DG|GT|GR|HG|JC|MC|MN|MS|NT|NL|OC|PL|QT|QR|SP|SL|SR|TC|TS|TL|VZ|YN|ZS|SM|NE)([a-zA-Z]{3})([a-zA-Z0-9\s]{1})\d{1}$+
Description
I use this one to validate CURP structure. CURP is a mexican unique identifier for certain intitutions like INFONAVIT and it's very useful
Matches
LAZM890202MYNNGR09
Non-Matches
SM890202MYNNGR09
Author Rating: The rating for this expression. Sergio Montero
Source
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: Gracias!
Name: José Luis Reyes
Date: 11/6/2017 4:41:03 AM
Comment:
Funcionó perfecto sin el último "+", muchas Gracias!


Title: Gracias
Name: Alex Suárez
Date: 6/28/2013 2:42:10 PM
Comment:
A mí me funcionó así: var reg = /^[a-zA-Z]{4}((\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)(H|M)(AS|BC|BS|CC|CL|CM|CS|CH|DF|DG|GT|GR|HG|JC|MC|MN|MS|NT|NL|OC|PL|QT|QR|SP|SL|SR|TC|TS|TL|VZ|YN|ZS|SM|NE)([a-zA-Z]{3})([a-zA-Z0-9\s]{1})\d{1}$/i; if (reg.test(curp)) { //código} by asuarez


Title: Gracias
Name: Alex Suárez
Date: 6/28/2013 2:41:59 PM
Comment:
A mí me funcionó así: var reg = /^[a-zA-Z]{4}((\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)(H|M)(AS|BC|BS|CC|CL|CM|CS|CH|DF|DG|GT|GR|HG|JC|MC|MN|MS|NT|NL|OC|PL|QT|QR|SP|SL|SR|TC|TS|TL|VZ|YN|ZS|SM|NE)([a-zA-Z]{3})([a-zA-Z0-9\s]{1})\d{1}$/i; if (reg.test(curp)) { //código} by asuarez


Title: Increible, gracias
Name: Ricardo Baños
Date: 3/8/2010 12:00:36 PM
Comment:
El código funciona excelente, lo estoy usando sobre Django, como comentario a mi me funciono, quitando el ultimo identificador (+), osea sin el ultimo mas (+) gracias.


Title: Increible, gracias
Name: Ricardo Baños
Date: 3/8/2010 11:55:53 AM
Comment:
El código funciona excelente, lo estoy usando sobre Django, como comentario a mi me funciono, quitando el ultimo identificador (+), osea sin el ultimo mas (+) gracias.


Title: Thanks!!!
Name: Abraham
Date: 10/15/2009 6:57:24 PM
Comment:
Gracias! funciona!


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