Skip to content

Regex Tester

DQS uses Java-compatible regular expressions (java.util.regex.Pattern) for Validity checks and PII Detection patterns. Use this tester to validate your patterns before configuring them in the Builder.

/ /
Enter a regex and test string above.
Pattern NameRegexDescription
Email^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$Standard email format
Phone (International)^\+?[1-9]\d{1,14}$E.164 international phone format
Phone (US)^\(?[2-9]\d{2}\)?[\s.\-]?\d{3}[\s.\-]?\d{4}$US phone with optional formatting
URL^https?://[^\s/$.?#].[^\s]*$HTTP/HTTPS URL
ZIP Code (US)^\d{5}(-\d{4})?$US ZIP code (5 or 9 digit)
Postal Code (UK)^[A-Z]{1,2}\d[A-Z\d]?\s*\d[A-Z]{2}$UK postal code
Postal Code (DE)^\d{5}$German postal code
ISO Date^\d{4}-\d{2}-\d{2}$YYYY-MM-DD format
ISO DateTime^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}ISO 8601 datetime
Currency (USD)^\$?\d{1,3}(,\d{3})*(\.\d{2})?$US dollar format
Percentage^\d{1,3}(\.\d{1,2})?%?$Percentage value (0-100)
Alphanumeric^[a-zA-Z0-9]+$Letters and digits only
No Special Chars^[a-zA-Z0-9\s.\-,]+$Letters, digits, spaces, basic punctuation
Salesforce ID (15)^[a-zA-Z0-9]{15}$15-character Salesforce ID
Salesforce ID (18)^[a-zA-Z0-9]{18}$18-character Salesforce ID
Domain Name^([a-zA-Z0-9\-]+\.)+[a-zA-Z]{2,}$Valid domain name
IPv4 Address^(\d{1,3}\.){3}\d{1,3}$IPv4 address format
Hex Color`^#([0-9a-fA-F]3[0-9a-fA-F]6)$`
Pattern NameRegexDescription
SSN (US)\b\d{3}-\d{2}-\d{4}\bSocial Security Number
SSN (unformatted)\b\d{9}\b9 consecutive digits (potential SSN)
Credit Card (Visa)\b4\d{3}[\s\-]?\d{4}[\s\-]?\d{4}[\s\-]?\d{4}\bVisa card number
Credit Card (MC)\b5[1-5]\d{2}[\s\-]?\d{4}[\s\-]?\d{4}[\s\-]?\d{4}\bMastercard number
Credit Card (Amex)\b3[47]\d{2}[\s\-]?\d{6}[\s\-]?\d{5}\bAmerican Express number
Credit Card (Generic)\b\d{4}[\s\-]?\d{4}[\s\-]?\d{4}[\s\-]?\d{4}\bAny 16-digit card pattern
IBAN\b[A-Z]{2}\d{2}[A-Z0-9]{4}\d{7}([A-Z0-9]?){0,16}\bInternational Bank Account Number
Passport (US)\b[A-Z]\d{8}\bUS passport number
PESEL (PL)\b\d{11}\bPolish national ID (11 digits)
NIP (PL)\b\d{3}-?\d{3}-?\d{2}-?\d{2}\bPolish tax ID
REGON (PL)\b\d{9}\bPolish business registry number
Date of Birth`\b(0[1-9]1[0-2])/(0[1-9]
Email in text[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}Email anywhere in text (no anchors)
Phone in text\b(\+?\d{1,3}[\s\-]?)?\(?\d{3}\)?[\s\-]?\d{3}[\s\-]?\d{4}\bPhone number in free text
IP Address\b(\d{1,3}\.){3}\d{1,3}\bIPv4 address in text
Driver License (US)\b[A-Z]\d{3,8}\bUS driver license (varies by state)
  • Anchored patterns (^...$) validate the entire field value — use for Validity checks
  • Unanchored patterns (no ^ / $) find matches within text — use for PII Detection
  • Apex regex is case-sensitive by default. Use (?i) at the start for case-insensitive matching
  • Test edge cases: empty strings, whitespace-only values, and Unicode characters