Test, validate and match regular expressions
Matches 16-digit credit card numbers in three common formats: a continuous run of 16 digits, four groups of 4 digits separated by spaces (e.g. 1234 5678 9012 3456), or four groups of 4 digits with optional hyphens (e.g. 1234-5678-9012-3456). Used with the global flag, it extracts all occurrences from text, making it suitable for payment form validation, data masking, or detecting card numbers (PII) in documents.