Regex Tester
Test JavaScript regular expressions against any text in real time. See highlighted matches, capture groups, and match positions. Everything runs in your browser.
Uses JavaScript RegExp syntax. Matches update in real time. Processed locally in your browser.
What is a Regex Tester?
A regex tester lets you write a regular expression pattern and instantly see which parts of a text string it matches. This tool uses the native JavaScript RegExp API — the same engine used in Node.js, browsers, and most JavaScript runtimes.
How to use
- Enter a pattern in the regex input field (without surrounding
/delimiters — those are shown for context only). - Toggle flags as needed —
gfor global,ifor case-insensitive,mfor multiline, etc. - Paste test text in the text area.
- Matches appear immediately — highlighted in the text and listed in the match details panel.
Regex flags
g— Global: find all non-overlapping matches. Without this flag, only the first match is returned.i— Case-insensitive:Amatchesa.m— Multiline:^and$match at line boundaries, not just start/end of string.s— Dot-all:.matches newline characters.u— Unicode: enables full Unicode character class escapes like\p{L}.y— Sticky: matches only at the current position (lastIndex).
Examples
- Email addresses:
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,} - Dates (YYYY-MM-DD):
(\d{4})-(\d{2})-(\d{2})— uses capture groups for year, month, day. - Words:
\b\w+\bwith flagg. - HTML tags:
<[^>]+> - Hex colour codes:
#[0-9a-fA-F]{6}
Capture groups
Groups defined with (…) are shown in the match detail panel as Group 1, Group 2, etc. Each group corresponds to the text captured by that parenthesised sub-expression.
Non-capturing groups (?:…) and lookaheads/lookbehinds (?=…) / (?<=…) are supported because the tool uses the full native JavaScript regex engine.
FAQ
- Why does my regex only return one match? Make sure the
g(global) flag is enabled. Without it, JavaScript regex returns only the first match. - Can I test Unicode and emoji? Yes — enable the
uflag for proper Unicode support. Emoji are treated as single code points. - Does the tool use eval()? No. Regex patterns are passed directly to the
RegExpconstructor — noeval()is involved. - Is my pattern or text sent anywhere? No. Everything runs locally in your browser.
Privacy
Your regex patterns and test text are processed entirely in the browser using the native JavaScript RegExp API. No data is transmitted to any server.