Skip to main content
A bare regex is a false-positive machine: every nine-digit number becomes an SSN, every sixteen-digit number a credit card. Deasy Labs pattern tags avoid that with context keywords: the pattern only counts when corroborating words appear near the match. And you don’t engineer either part by hand. Describe what matters, and the platform suggests the regex, the context keywords, and the corroboration threshold from your data, then generates test cases to prove precision before anything runs at scale.

The Loop

Step 1. Suggest the Pattern from Your Data

Give the platform a description and real examples. It returns the regex, the context keywords, the corroboration threshold, and an explanation of its reasoning.
The negative_examples are what teach it precision: the same digit shape in an order number must not match, so the suggestion leans on context keywords like “SSN” and “social security” to separate the two.

Step 2. Prove It with Test Cases

Generate test cases covering matches, near-misses, and edge cases, then evaluate the pattern against them before it touches production data.
If a case fails, feed it back: call suggest_patterns again with the failing text as current_wrong_result or an added negative example, and re-evaluate. The loop converges in a round or two.

Step 3. Create the Tag and Run It

The tag carries the full pattern configuration. Detection is deterministic and costs no LLM calls at classification time.
Run it in a classification job like any other tag, then gate slices on the result as in Protect Sensitive Data.

Why Context Keywords Matter

Next Steps

Protect Sensitive Data

The built-in classifiers and the gated slice.

Taxonomies and Tags

The three tag strategies side by side.