Test, validate and match regular expressions
Matches US postal codes (ZIP codes) in either the standard 5-digit format (e.g., 90210) or the extended ZIP+4 format with a hyphen and 4 additional digits (e.g., 90210-1234). Note that \d{4}\d is a redundant way of writing \d{5}. With the global and multiline flags, it validates or extracts ZIP codes line-by-line, making it useful for processing address lists or multiline text.