Regex Tester
Live Matches & Capture Groups
Test JavaScript regular expressions with live match highlighting, capture groups, and g, i, m flag controls.
What is this tool?
This regex tester runs JavaScript regular expressions against sample text and shows matches, match count, and capture groups. It supports the common g, i, and m flags exposed by the UI.
Because it uses the browser's JavaScript regex engine, behavior matches JavaScript semantics rather than PCRE, Python, .NET, or RE2. Lookbehind support, Unicode behavior, escaping, and backtracking characteristics depend on the JavaScript runtime.
Use it to build validation patterns, debug capture groups, test log extractors, verify filename rules, and understand how a pattern behaves before moving it into application code.
How to use
- Enter a JavaScript regex pattern without surrounding slash delimiters.
- Toggle the
g,i, andmflags as needed. - Paste sample text into the test string area.
- Review match count, highlighted matches, and capture groups.
Examples
| Input / setting | Output | Notes |
|---|---|---|
pattern \d+; text Order 123 | 1 match: 123 | Find a numeric sequence. |
pattern user-(\d+); text user-42 | 1 match: user-42; capture group 42 | Extract an ID. |
pattern [; text anything | Invalid regex | Syntax errors are reported. |
Related tools & concepts
Last reviewed: 2026-05-08