Saturday 8 March 2008

Useful Regular Expressions for Recogonizers

Regular expressions can be a bit of a head scratcher if you haven't been exposed to them before, so if you are reading this and you want to have a play with the Recognizers in widgets here are some examples :-

UK Postal Codes:

US Zip Codes (5 or 5-4)

IP Addresses :

ISBN Numbers :
^ISBN\s(?=[-0-9xX ]{13}$)(?:[0-9]+[- ]){3}[0-9]*[xX0-9]$

Date in the format 99/99/9999

USA Phone numbers in the format ANN-NNN-NNNN where A=2-9 and N=0-9

I have opened up this page on the IBM LDD Wiki to be a resource for useful RegExps that might be worth sharing with the rest of the lotus world. So come on all you RegExp-ers and RegExp-ettes, please nip over to the page and add to the list. There is nothing like a good list of examples so that folk can get their heads around a new skill.


1 comment:

Carl Tyler said...

another really great site for regular expressions and help with regular expressions is

Disqus for Domi-No-Yes-Maybe