Side note: GIR 0AA
is listed as an exception in your regular
expression because it is a valid UK
post code for what are esentially
historical reasons (search for it in
the Wikipedia article, it's given
special mention).
There is no trivial regular expression you can write to validate a UK post code as there's no surety that, for example, GU78 2AB is valid (the GU78 outward area may only contain 2A*A*, but not 2A*B*), whereas GU77 2AB may well be considered valid.
You can use a regular expression to validate the form and structure of a piece of text to determine if it matches the requirements to be considered a post code. I believe that, broadly speaking, the following regular expression will satisfy that:
(([A-Z]{1,2}[0-9]{1,2})\ ([0-9][A-Z]{2}))|(GIR\ 0AA)$