What is a regex tester?
The regex tester runs JavaScript RegExp patterns against your text in a disposable Web Worker. It highlights matches, lists capture groups and previews replacement strings. Each worker is terminated after about 500 ms, with caps on pattern length, input length, replacement size and displayed matches.
Features
- JavaScript g, i, m, s, u and y flags
- Live highlighting and capture groups
- Replacement preview and copy
- 500 ms disposable-worker timeout
- Clear invalid-pattern and size errors
How to use the regex tester
- Enter Pattern without slash delimiters.
- Choose Flags and paste Test text.
- Optionally enter Replacement using capture references.
- Read Highlighted matches, the capture table and Replace preview.
- Simplify the pattern if matching times out.
Worked example
Pattern (\w+)=(\d+), flag g and text tea=12 milk=3 produce two matches at indexes 0 and 7. Replacement $1:$2 previews tea:12 milk:3. Turning off g limits the operation to the first match.
Bounds and engine scope
Use at most 1,000 pattern characters, 20,000 input characters, 2,000 replacement characters and 1,000 matches. Empty matches show a marker. Indexes count UTF-16 code units. This is your browser's JavaScript engine, so another regex engine may behave differently. ECMAScript RegExp specification.
Frequently asked questions
Should I include / at either end of the pattern?
No. Enter only the pattern body and choose flags using the checkboxes. Slashes in the field are treated as literal pattern content.
Why did matching stop after 500 ms?
The worker exceeded the time budget. Shorten the input or simplify overlapping quantifiers. A timeout does not prove that the pattern has no matches.
Why do I see only one match?
Without g, only the first match is returned. The sticky y flag also requires a match at the current cursor, initially position zero.
How do I insert a captured group?
Use $1 or $2 for numbered captures and $<name> for named captures. $& inserts the full match and $$ inserts a dollar sign.
Does this validate patterns for every language?
No. It uses the browser's JavaScript RegExp engine and supported flags. Check behavior again in the engine where your pattern will run.
Last updated 16 November 2026. Made by Criza Labs. Spotted a mistake? Tell us.