Regex Test

Build and test regular expressions for DLP rules. Type a pattern and some sample text to see matches highlighted live, with capture groups, substitution, and a token-by-token explanation. Switch engines to check how a pattern behaves under ECMAScript (JavaScript), RE2 (the linear-time engine used by Go and many DLP products), or PCRE. Browse the built-in library of common DLP patterns below. Everything runs in your browser — nothing is sent anywhere.

Engine

ECMAScript and RE2 run instantly. PCRE loads a small engine on first use. For DLP rules written for .NET or Python, the PCRE engine is the closest match (PCRE supports lookbehind, backreferences, and named groups), though minor syntax differences remain.

/ /

Explanation
    Quick reference (ECMAScript)
    TokenMatches
    .any character (except newline)
    \d \Ddigit / non-digit
    \w \Wword char / non-word char
    \s \Swhitespace / non-whitespace
    \b \Bword boundary / non-boundary
    [abc] [^abc]character set / negated set
    [a-z]character range
    TokenRepeats
    * + ?0+, 1+, 0 or 1
    {n} {n,} {n,m}exactly / at least / range
    *? +?lazy (non-greedy)
    (…)capture group
    (?:…)non-capturing group
    (?<name>…)named capture group
    a|balternation
    ^ $start / end (of line with m)

    RE2 uses the same core syntax but omits backtracking features such as lookbehind and backreferences; it guarantees linear-time matching in return.

    DLP pattern library

    103 ready-made patterns for common sensitive-data types. Click any pattern to load it into the tester above.