Test, validate and match regular expressions
Matches UK postcodes in standard outward/inward formats such as M1 1AE, SW1A 1AA, or EC1A 1BB, with an optional space separating the parts. It also covers the special Girobank postcode GIR 0AA. The first letter is the mandatory area, followed by an optional district letter (excluding I, J, Z), a digit, and an optional alphanumeric. Commonly used for validating UK address forms or extracting postcodes from text.