Regex Tester
Test regular expressions against sample text with live match results and capture groups.
Runs in your browser — your data never leaves your deviceFree, no sign-up
How it works
Your pattern is compiled with the browser’s own RegExp engine — so behaviour (including error messages) matches what your JavaScript code will see. The compiled expression runs only against the text in this page, never anywhere else. Matches are listed with their position, numbered and named capture groups, and highlighted in place.
The five standard flags (g, i, m, s, u) are individual checkboxes, so you can see exactly which flags change the outcome.
Features
- Match list with positions and full capture groups
- Named group support ((?<name>…))
- In-place match highlighting in the test text
- Standard flags as explicit checkboxes
- Engine-accurate errors for invalid patterns
- 100% client-side — nothing leaves your browser
How to use
- Enter the pattern (without surrounding slashes).
- Toggle the flags you need.
- Paste test text and press Test pattern.
- Read the matches, groups and highlighted text.
Example
Pattern: (\w+)@([\w.-]+)\.[a-z]{2,}
Text: support@devcodivo.com
Match: support@devcodivo.com
group 1: support
group 2: devcodivo.comFrequently asked questions
- Which regex flavor does this tester use?
- The exact same one your browser uses — JavaScript (ECMAScript) regular expressions. That makes it an honest tester for code that will run in JavaScript: what matches here matches in your app. PCRE, .NET or Rust regex may behave differently (lookbehind, Unicode classes, possessive quantifiers).
- Why is my pattern invalid here but works elsewhere?
- Most often it uses features JavaScript doesn't support — possessive quantifiers (a++), K, named character classes like p{letter} without the u flag, or callouts. The error message shows the engine's own explanation of where it gave up.
- What do the numbered groups mean?
- Groups are the parenthesized parts of your pattern, numbered by their opening parenthesis from left to right. Group 1 is the first pair of parentheses. A group shows "(not matched)" when it is optional or part of an alternation that didn't participate in that match.
- Can regexes be dangerous?
- Complex regexes can exhibit catastrophic backtracking — matching time explodes on certain inputs (this is a real denial-of-service vector on servers). This tool caps results at 5000 matches to stay responsive, but if the tab freezes, your pattern has a backtracking problem worth fixing.
- Is my text sent to a server?
- No. The pattern is compiled and executed entirely in your browser. Nothing you enter is transmitted anywhere — you can verify this in your browser's network inspector.