An Entrepreneur, Coach, IT Consultant, Strategic Adviser, and a Traveler craving to explore and contribute to forming a better society.

Friday, August 21, 2009

UK Postcode Validation - Regular Expression (Regex)

3 comments :
UK Postcode - Regular Expression:

UK Postcode - Regular Expression General Pattern (Without Space):
/^[a-zA-Z0-9]{3,9}$/

UK Postcode - Regular Expression General Pattern (With Space):
/^[a-zA-Z0-9 ]{3,9}$/

UK Postcode - Regular Expression - Pattern1:

/^[a-zA-Z][a-zA-Z0-9][0-9]{3}$/

UK Postcode - Regular Expression - Pattern2:
/^[a-zA-Z][a-zA-Z0-9][0-9][0-9]{4}$/

The above regex's are for valid uk postcode; you may have to use any/all of the patterns depending on your requirement

3 comments :

serenawilliams said...

Earning money online never been this easy and transparent. You would find great tips on how to make that dream amount every month. So go ahead and click here for more details and open floodgates to your online income. All the best.

serenawilliams said...

Earning money online never been this easy and transparent. You would find great tips on how to make that dream amount every month. So go ahead and click here for more details and open floodgates to your online income. All the best.

mariah said...

Earning money online never been this easy and transparent. You would find great tips on how to make that dream amount every month. So go ahead and click here for more details and open floodgates to your online income. All the best