Regex Tester
Type a pattern and a test string to see every match highlighted as you type.
Flags
Preview:
Copied to clipboard.
Live Results
Plain-English Breakdown
Active Flags:
Regex Syntax Cheat Sheet
Anchors
^Start of string (or line with m flag)$End of string (or line with m flag)\bWord boundary\BNon-word boundary
Character Classes
.Any character (except newline unless s flag)\dDigit (0-9)\DNon-digit\wWord character (a-z, A-Z, 0-9, _)\WNon-word character\sWhitespace\SNon-whitespace[...]Any character inside brackets[^...]Any character NOT inside brackets
Quantifiers
*0 or more+1 or more?0 or 1{n}Exactly n times{n,}At least n times{n,m}Between n and m times*? +? ??Lazy (non-greedy) match
Groups and Lookaround
(...)Capturing group(?:...)Non-capturing group(?=...)Positive lookahead(?!...)Negative lookahead(?<=...)Positive lookbehind(?<!...)Negative lookbehind
How to use it
- Enter a pattern between the slashes, or start from one of the presets.
- Open the Flags menu and tick the flags you need.
- Paste your text into the test string box. Matches are highlighted as you type.
- Open the Details tab to see each match with its position and capture groups.
The plain-English breakdown lists what each part of the pattern does, and Copy regex puts the full pattern with its flags on your clipboard.
Frequently Asked Questions
Which regex flavor does the tester use?
The JavaScript regular expression engine of your browser. Patterns that rely on features from other flavors, such as PCRE possessive quantifiers, may behave differently or be rejected.
What do the flags do?
g finds all matches instead of the first one, i ignores case, m lets ^ and $ match at line breaks, s lets the dot match newlines, u turns on full Unicode matching and y matches only at the position where the last match ended.
Is my text uploaded anywhere?
No. The pattern and the test string are processed in your browser and are not sent to a server.
Why is my pattern slow or freezing the page?
Nested quantifiers such as (a+)+ can cause catastrophic backtracking on certain inputs. Make the pattern more specific, for example by replacing .* with a narrower character class.
Are there ready-made patterns?
Yes. The preset buttons load example patterns with sample text for email addresses, domain names, URLs and IPv4 addresses. A syntax cheat sheet sits below the results.
More tools
Cron Expression Generator
Build cron expressions and read them in plain English.
Base64 Encoder / Decoder
Encode and decode Base64 with UTF-8 and URL-safe support, or turn a file into a data URL.
JWT Decoder
Decode JSON Web Token headers and payloads locally.
UUID Generator
Generate random UUIDs in bulk.
Hash Generator
Create SHA-1, SHA-256, SHA-384 and SHA-512 hashes of text or files in your browser.
URL Encoder / Decoder
Percent-encode and decode URLs and query strings.
Published