b2KIT

Sensitive Data Regex Library

Library of regex patterns for detecting SSNs, credit cards, API keys, passwords, and PII in text. Test patterns on sample data.

Tested tool guide Tested browser tools Checked August 16, 2026

What Sensitive Data Regex Library does, with a checked example

A reference library of regular expressions for the data shapes that leak most: Social Security numbers, credit card numbers, API keys, passwords, and other personally identifiable information. You pick a category, read the pattern, and paste sample text to see every match highlighted with a count. All matching runs in the browser against the text in front of you, so you can scan real-looking data without sending it anywhere. The thing users most often get wrong: a match proves format, not validity. The pattern recognizes a string that looks like an SSN or a card; it cannot tell you whether the number is real.

Worked example

A concrete input and expected output from the current implementation.

Input

Customer 123-45-6789 called about order 555-12-3456; ticket 99-1234 was filed.

Expected output

2 matches: 123-45-6789 and 555-12-3456

The SSN pattern \b\d{3}-\d{2}-\d{4}\b requires exactly three digits, a hyphen, two digits, a hyphen, then four digits, with word boundaries on each side. Both flagged strings have that shape; 99-1234 has only two digits before its hyphen, so it cannot be consumed, and the second match shows the pattern cannot tell a phone-style number from an SSN.

How the result is produced

1

Category-based pattern library

The library is organized by data type, not by use case. Each entry pairs a prewritten pattern with example strings that should and should not match, so the pattern's format assumptions are visible before you use it. Pasting text runs the selected pattern across the whole input and marks every occurrence; switching categories re-runs the same text immediately, which makes comparing coverage across data types a one-click operation.

2

Shape matching, not identity checking

The regex engine reports every place a sequence of digits, dashes, and letter runs fits the selected pattern. Nothing consults a registry of issued numbers, so a match means 'this text has the shape of a credit card', not 'this is a real card'. The reverse gap matters too: formats the pattern does not include, such as an SSN written without dashes, pass through unreported.

Good uses

  • Pre-paste screening: before dropping a log excerpt, CSV row, or support ticket into a shared chat or bug tracker, run it through the library to see whether it contains strings that look like SSNs, cards, or keys.
  • Code and config audit: scan source files and .env-style snippets for hardcoded credentials, catching API keys and password-shaped assignments before they get committed.
  • Coverage check for redaction rules: paste representative samples of your own data and see which sensitive formats match and which fall through, revealing gaps in your masking or DLP configuration.

Limits and checks

  • Format is not validity: 123-45-6789 matches the SSN pattern even though it is a fictional, never-issued number, and a phone number in the right shape matches too. A real SSN written 123456789 with no dashes is equally invisible unless the pattern includes a grouped variant.
  • Patterns differ across libraries: the exact regexes here, such as which card networks are covered or whether separators must be dashes or may be spaces, will not match your DLP vendor's patterns character for character. Treat a clean result as evidence about this library, not a guarantee about another scanner.
  • Short-key categories are noisy: generic patterns for passwords and API keys lean on length and character-class heuristics, so ordinary text containing hex hashes, UUIDs, or base64 fragments produces frequent false positives. Read hits as leads to review, not confirmed secrets.

Common questions

Does scanning my text send it anywhere?

No. The pattern matching runs entirely in the browser on your machine; nothing you paste is uploaded, which is exactly why the tool can accept text containing real-looking SSNs and card numbers without asking you to scrub it first. The usual judgment still applies: do not paste live secrets into any web page you would not otherwise trust.

Why did it flag a phone number, and why did it miss my SSN?

Both answers are the same: the regex matches character shape, not meaning. A 10-digit number with hyphens in the right places matches the SSN pattern whether it is a phone number or not, and an SSN written without dashes matches nothing unless the pattern for that category includes a grouped form. Check the pattern's format assumptions before you trust a negative result.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools