Skip to content
Private Preview
Join Waitlist →

Custom Patterns

Teach Redactorr to detect your organization-specific data

4 min readAuthor: Redactorr Support Team · [email protected]Last reviewed: March 2026

Custom Patterns: Teaching Redactorr Your Secrets

Redactorr comes with 3,000+ built-in detection rules for common sensitive data like emails, SSNs, and API keys. But what about your organization's unique identifiers?

That's where custom patterns come in.

What Are Custom Patterns?

Custom patterns are rules you create to tell Redactorr: "This format is sensitive in our organization, please detect it."

Examples:

  • Customer IDs: CUST-123456
  • Project codes: PX-2024-089
  • Internal employee numbers: EMP-2024-1089
  • Custom API keys: mycompany_sk_live_abc123
  • Serial numbers: SN-A1B2C3D4

Creating Your First Custom Pattern

Go to Settings → Custom Patterns**

Click "Add Pattern"**

1 / 2

You'll see a form:

  • Name: What to call this pattern (e.g., "Customer ID")
  • Regex: The pattern to match (e.g., CUST-\d{6})
  • Category: What type of data (PII, Credentials, Custom, etc.)
  • Test: Sample data to verify your pattern works

Write Your Regex**

1 / 1

If you're not familiar with regex (regular expressions), here's a quick primer:

SymbolMeaningExample
\dAny digit (0-9)\d\d\d matches "123"
\wAny word character\w+ matches "hello"
+One or more\d+ matches "123" or "4567"
{n}Exactly n times\d{4} matches "2024"
[A-Z]Any uppercase letter[A-Z]{2} matches "US"
.Any character... matches "abc" or "123"

Test Your Pattern**

1 / 1

In the "Test" box, paste sample data:

text
CUST-123456
CUST-999999
CUST-000001

Click "Test Pattern". Redactorr will show which strings match and which don't.

Save and Activate**

1 / 1

Click "Save". Your pattern is now active and will be included in all future detections.

Real-World Examples

Customer Account Numbers

Format: ACC-YYYY-NNNN Regex: ACC-\d{4}-\d{4} Matches: ACC-2024-1089, ACC-2023-5678 Doesn't Match: ACC-24-01, ACCT-2024-1089

Project Codes

Format: PX-YYYY-NNN Regex: PX-\d{4}-\d{3} Matches: PX-2024-001, PX-2025-456 Doesn't Match: PROJECT-2024-001, PX-24-1

Internal Email Format

Format: [email protected] Regex: \w+\.\w+\.\d+@company\.com Matches: [email protected] Doesn't Match: [email protected] (no employee ID)

Serial Numbers

Format: SN-XXXXX (5 uppercase letters/digits) Regex: SN-[A-Z0-9]{5} Matches: SN-A1B2C, SN-99999 Doesn't Match: SN-abc12 (lowercase), SN-123 (too short)

Advanced: Optional Validation

For extra accuracy, you can add a JavaScript validator function:

javascript
function validateCustomerId(value) {
  // Extract the number part
  const match = value.match(/CUST-(\d{6})/);
  if (!match) return false;

  const num = parseInt(match[1]);

  // Customer IDs must be between 100000 and 999999
  return num >= 100000 && num <= 999999;
}

This ensures "CUST-000001" (invalid) isn't detected, but "CUST-123456" (valid) is.

Managing Your Patterns

Edit: Click any pattern to modify its regex or name Disable: Toggle off patterns you don't need right now (keeps them for later) Delete: Remove patterns you'll never use again Export: Download all your custom patterns as JSON (for backup or sharing with team) Import: Load patterns from a JSON file

Team Sharing

If your whole team needs the same custom patterns:

Create patterns on your account

Click "Export Patterns"

Share the JSON file with your team (via Slack, email, etc.)

They click "Import Patterns" and upload the file

1 / 4

Now everyone has the same detection rules.

Pro Tips

Start Simple Don't try to match every edge case on your first try. Start with the core pattern and refine as you test.

Use Test Data Keep a file of sample IDs to test against. This helps verify your pattern works before deploying.

Category Matters Assign the right category. "PII" shows up in red (high severity), "Custom" in blue (low severity).

Version Control Export your patterns regularly. If you mess up a regex, you can restore from backup.

Combine with Whitelisting If your pattern is too broad and catches test data, whitelist the test patterns (like "CUST-000000").