Wrox Home  
Search P2P Archive for: Go

  Return to Index  

regular_expressions thread: Re: Welcome to the new Regular Expressions List


Message #1 by "Brian thomson" <bthomson@e...> on Tue, 16 Jul 2002 09:20:04
I've never used the Donut IDE, I'm afraid, and I've never looked for 
regular expressions for such things. I've just created them when 
necessary. E.g., for a UK postcode, set to IgnoreCase and:

[A-Z]{1,2}\d{1,2}[A-Z]?\s*\d[A-Z][A-Z]

This isn't ideal. I have a feeling that the last letter in the first part 
of this postcode currenly only occurs on postcodes starting WC, or SE.

If that's the case, then replace with the following:

([a-z]{1,2}\d{1,2}|wc\d[a-z|se\d[a-z])\s*(\d)[a-z][a-z]

This will only allow letters after the first part if they start with WC or 
SE, followed by a single digit. It also groups the first part and the 
digit on the second part. These are the parts of postcodes that define the 
village or town.

> Well, I'll start the ball rolling. 
I>  like the regex control in Donut, but where can I find a list of reg ex 
t> emplates for european /asian postcodes and phone numbers - and how 
could 
I>  add my regex's to the wizard in the Donut IDE?

> TIA Brian

  Return to Index