Test, validate and match regular expressions
Matches simplified UK postcodes in two forms: a full code with an optional space separator (1-2 letters + 1-2 digits for the outward code, then a digit + 2 letters for the inward code), or the outward district code alone (e.g., 'M1', 'DN55'). Case-insensitive. Note it doesn't cover all official UK postcode variants like 'EC1A' or 'W1A'. Typically used for UK address validation and form input checks.