Test, validate and match regular expressions
This regex matches sequences of digits, parentheses, spaces, and hyphens that are at least 8 characters long, or runs of 8-12 digits optionally separated by spaces. It's designed to catch phone numbers in various formats like '(555) 123-4567', '555-123-4567', or '5551234567', as well as longer digit strings such as credit card-like numbers. Commonly used with the global flag to extract or redact phone numbers and numeric identifiers from text.