Build, test, and debug regular expressions
Validates UK postcodes in both compact and spaced formats such as M1 1AE, EC1A 1BB, or DN55 1PT. It matches the outward code (1-2 letters, a digit, and an optional letter or digit), an optional whitespace separator, and the inward code (a digit followed by two letters). The global and multiline flags allow it to find multiple postcodes across separate lines within a single input string.