Test, validate and match regular expressions
Matches US ZIP codes in both standard 5-digit format (e.g., 90210) and extended ZIP+4 format (e.g., 90210-1234). The pattern uses word boundaries at the start and end to ensure the ZIP code stands alone rather than being part of a longer digit sequence. Ideal for address form validation, extracting postal codes from unstructured text, and input sanitization in shipping or location-based applications.