Test, validate and match regular expressions
This regex detects US Social Security Numbers (SSNs) and major credit card numbers for Data Loss Prevention (DLP) systems. It matches SSNs in formats like XXX-XX-XXXX, XXX XX XXXX, or 9 consecutive digits, and credit cards from major issuers including Visa, Mastercard, Amex, Discover, Diners Club, and JCB with optional separators. The pattern uses negative lookbehind/lookahead to avoid partial matches within longer digit sequences, reducing false positives in security scanning and compliance monitoring applications.