in reply to
UK postcode regex
Two transformations works well:
s/(\w{3,5})\s*(\w{3})/\U$1 $2/; s/ O/ 0/;
[download]
Update: conforms to specs cited by Mutant.
Caution:
Contents may have been coded under pressure.
Comment on
Re: UK postcode regex
Download
Code
In Section
Seekers of Perl Wisdom