Domain Security Info
RegEx Patterns
Updated May 1, 2026, 8:32 AM
Managing regex patterns#
Regex patterns let you match TXT records that have complex or changing formats. Use them when a simple text prefix is not enough to identify a service.
What are regex patterns?#
Most TXT record tags use prefix matching. They check whether a record starts with a known string like google-site-verification=. This works well when every record from a service begins the same way.
Some services use TXT records with formats that vary from domain to domain. For example, a service might use records like example-verify-abc123 where the last part changes every time. A prefix match on example-verify- would work, but a regex pattern like ^example-verify-[a-z0-9]+$ gives you tighter control and avoids false matches.
When to use regex patterns vs. TXT tags#
| Use case | Use this |
|---|---|
| Record always starts with the same text (like google-site-verification=) | TXT tag with prefix matching |
| Record is always exactly the same text | TXT tag with exact matching |
| Record has a variable format that can't be matched by prefix alone | Regex pattern |
| Record uses a complex format with numbers, hashes, or UUIDs in unpredictable positions | Regex pattern |
Regex pattern fields#
| Field | Required | Description |
|---|---|---|
| Pattern | Yes | A regular expression to match against TXT records. Must be a valid regex. |
| Service name | Yes | The name displayed in the badge when this pattern matches (for example, "Stripe Verification"). |
| Color | No | Hex color code for the badge (for example, #635BFF). |
| URL | No | A link to the service. Makes the badge clickable. |
| Priority | No | Determines matching order. Lower numbers are evaluated first. |
| Active | Yes | Whether this pattern is currently being used for matching. Inactive patterns are ignored. |
Creating a regex pattern#
- Go to Regex Patterns under Manage Data in the navigation.
- Click Add Regex Pattern.
- Enter the regular expression in the Pattern field.
- Enter a Service name that users will see in the badge.
- Optionally set a Color, URL, and Priority.
- Make sure Active is enabled.
- Click Save.
Tips for writing patterns#
- Test your regex against real TXT records before saving. An overly broad pattern can cause false matches.
- Be as specific as possible. Use anchors (
^for start,$for end) when the entire record should match. - Escape special characters. If the record contains dots, use
\.instead of.in the pattern. - Use character classes for variable parts:
[a-zA-Z0-9]+for alphanumeric strings,[0-9a-f]{32}for hex hashes. - Set a priority if you have overlapping patterns. Lower priority numbers are checked first.
Common regex pattern examples#
| Pattern | What it matches | Service |
|---|---|---|
| ^[a-f0-9]{32}$ | 32-character hex strings (common verification tokens) | Various verification services |
| ^_[a-z]+-challenge= | Challenge tokens with underscore prefix | ACME/certificate challenges |
| ^[A-Za-z0-9+/=]{40,}$ | Long base64-encoded strings | Various verification services |
Editing a regex pattern#
- Go to Regex Patterns in the navigation.
- Find the pattern in the list.
- Click Edit in the Actions column.
- Update the fields.
- Click Save.
Deleting a regex pattern#
- Go to Regex Patterns in the navigation.
- Find the pattern in the list.
- Click Delete in the Actions column.
- Confirm the deletion.
How regex matching fits into the lookup process#
When the tool processes TXT records during a domain lookup, it follows this order:
- TXT tag exact match โ Does the record exactly equal a known pattern?
- TXT tag prefix match โ Does the record start with a known pattern?
- Regex pattern match โ Does the record match any active regex pattern?
The tool stops at the first match. This means TXT tags take priority over regex patterns. If both a TXT tag and a regex pattern could match the same record, the TXT tag wins.
Regex patterns are evaluated in priority order (lowest number first). If multiple regex patterns match the same record, the one with the lowest priority number is used.
Searching and filtering#
The regex patterns list supports:
- Search by pattern text โ Find patterns containing specific text.
- Search by service name โ Find patterns for a specific service.
- Filter by active status โ Show only active or inactive patterns.