Regex Tester
Regex Tester runs your pattern with the browser's own JavaScript regular expression engine — the same RegExp behaviour you get in Node or a browser console, not PCRE, Python, Java, or .NET.
JavaScript regular expressions
JavaScript syntax: $& whole match, $1 group 1, $<name> named group, $$ literal $. Without the g flag only the first match is replaced.
Cheatsheet
Character classes
.- Any character except newline (all characters with the s flag)
\d- Digit 0-9
\D- Non-digit
\w- Word character: letter, digit or underscore
\s- Whitespace (space, tab, newline…)
[abc]- One of a, b or c
[^abc]- Any character except a, b or c
[a-z]- Range: any lowercase letter
Quantifiers
*- 0 or more
+- 1 or more
?- 0 or 1 (optional)
{n}- Exactly n times
{n,}- n or more times
{n,m}- Between n and m times
*? +? ??- Lazy: match as few as possible
Anchors & boundaries
^- Start of string (start of line with the m flag)
$- End of string (end of line with the m flag)
\b- Word boundary
\B- Not a word boundary
Groups & references
(…)- Capturing group, numbered from 1
(?:…)- Non-capturing group
(?<name>…)- Named capturing group
\1- Backreference to group 1
\k<name>- Backreference to a named group
a|b- Alternation: a or b
Lookaround
(?=…)- Lookahead: followed by
(?!…)- Negative lookahead: not followed by
(?<=…)- Lookbehind: preceded by
(?<!…)- Negative lookbehind: not preceded by
Escaping
\.- A literal dot (escape . * + ? ( ) [ ] { } ^ $ | \ /)
\\- A literal backslash
\uXXXX- Unicode code unit; \u{XXXX} with the u flag
How to use it
- Enter your regular expression in the Pattern field and tick the flags you need
- Paste or type the text to run it against in Test text
- Select Test regex to see the match count, highlighted matches, and every capture group
- Add a replacement to preview substitutions, then copy the matches or the replaced text
Enter a pattern, pick the flags you need (g, i, m, s, u, y, and d for match indices), and paste the text to test against. It reports how many matches were found and how many capture groups the pattern declares, then lists every match with its start and end position, its numbered groups, and any named groups such as (?<year>\d{4}); a group that did not participate is shown as undefined rather than an empty string. The test text is redrawn with each match highlighted and numbered, so overlaps and zero-length matches stay visible. A replacement field applies JavaScript's native syntax — $&, $1, $<name>, $$ — and without the g flag only the first match is replaced. Each run executes in a dedicated Web Worker: long-running expressions are stopped after one second and the worker is discarded, which limits page freezes without being a guarantee against every pathological pattern. Beyond a yes/no match check it surfaces every group, previews replacements, and highlights results inline; a compact cheatsheet covers the common tokens. Everything runs in your browser and nothing you paste is uploaded.
FAQ
The engine is JavaScript's built-in RegExp, identical to what runs in a browser or in Node. Patterns written for PCRE, Python, Java, .NET, RE2, or Rust may behave differently here or fail to compile.
Yes. Each match lists its numbered groups such as $1 and $2, plus any named groups like (?<year>\d{4}). A group that did not take part in the match is shown as undefined rather than as a blank value.
It uses JavaScript's native String.replace, so $& is the whole match, $1 a numbered group, $<name> a named group, and $$ a literal dollar sign. Without the g flag, only the first match is replaced.
Each run happens in a separate Web Worker. If it does not finish within one second, the worker is stopped and discarded, an on-screen message says so, and the next run starts fresh. This limits freezes from heavy backtracking but is not a guarantee against every pathological pattern.
No. The pattern, the test text, and the replacement stay in your browser, and the match runs in a local Web Worker. Nothing is uploaded to Tooliba or a third party, and analytics records only that the tool was used.