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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^((AL)|(AK)|(AS)|(AZ)|(AR)|(CA)|(CO)|(CT)|(DE)|(DC)|(FM)|(FL)|(GA)|(GU)|(HI)|(ID)|(IL)|(IN)|(IA)|(KS)|(KY)|(LA)|(ME)|(MH)|(MD)|(MA)|(MI)|(MN)|(MS)|(MO)|(MT)|(NE)|(NV)|(NH)|(NJ)|(NM)|(NY)|(NC)|(ND)|(MP)|(OH)|(OK)|(OR)|(PW)|(PA)|(PR)|(RI)|(SC)|(SD)|(TN)|(TX)|(UT)|(VT)|(VI)|(VA)|(WA)|(WV)|(WI)|(WY))$
Description
This validates the states and territories of the United States in a 2 character uppercase format. Very poor excuse for a regular expression! ;) Written by Jason Gaylord.
Matches
NY | PA | NJ
Non-Matches
Pennsylvania | Pa | pa
Author Rating: The rating for this expression. Jason N. Gaylord
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: Shortened Version
Name: Gavin Kistner
Date: 1/16/2004 3:46:10 PM
Comment:
A[LKSZR]|C[AOT]|D[EC]|F[ML]|G[AU]|HI|I[DLNA]|K[SY]|LA|M[EHDAINSOT]|N[EVHJMYCD]|MP|O[KKR]|P[WAR]|RI|S[CD]|T[NX]|UT|V[TIA]|W[AIVY]


Title: memory
Name: Jakub Skopal
Date: 9/20/2003 5:17:34 AM
Comment:
beware, that every extra () grouping consumes memory and time by catching the match... @"^(AL|AK|AS|AZ|AR|CA|CO|CT|DE|DC|FM|FL|GA|GU|HI|ID|IL|IN|IA|KS|KY|LA|ME|MH|MD|MA|MI|MN|MS|MO|MT|NE|NV|NH|NJ|NM|NY|NC|ND|MP|OH|OK|OR|PW|PA|PR|RI|SC|SD|TN|TX|UT|VT|VI|VA|WA|WV|WI|WY)$" will work the same :-)


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