This post originated from an RSS feed registered with .NET Buzz
by Tim Sneath.
Original Post: Regular Expressions for UK Formats
Feed Title: Tim Sneath's Blog
Feed URL: /msdnerror.htm?aspxerrorpath=/tims/Rss.aspx
Feed Description: Random mumblings on Microsoft, .NET, and other topics.
It's often hard to find good UK-aware regular expressions (for use with the ASP.NET RegularExpressionValidator or the .NET RegEx class). I was therefore delighted to come across RegExLib.com, which contains a most comprehensive listing of commonly used regular expressions. I wish more US sites would take this into account too - not everyone has a telephone number of the form (xxx) xxx-xxxx!
One big gap is for UK telephone numbers - as with other European countries such as Germany, the number format can vary depending on the area code. There are several expressions listed at RegExLib, but none of them properly match the Ofcom recommended presentation style. Has anyone found a better regular expression that they'd like to share?
Also interesting to see a regular expression blog - worth tracking if you deal with these issues on a regular basis. Thanks to the mswebdev mailing list (run by Phil and Chris) for this pointer.