/pattern/flags in the pattern box; flags will auto-sync.How to use
Enter your pattern and input text, then choose what you want to do.
- Type a pattern (either
\d+or/\d+/g) and pick flags. - Select an action: Test, Match, Replace, or Split.
- Click Run to see the result JSON (or an error if the regex is invalid).
FAQ
Does this regex tool run server-side?
No—your pattern and text are processed locally in your browser (no network calls).
What regex flavor does this use?
It uses JavaScript RegExp (same behavior you get in modern browsers and Node.js).
Can I paste /pattern/flags directly?
Yes. If you paste something like /\d+/g, the tool will parse it and sync the flag checkboxes.
Why do I only see the first match sometimes?
Without the g flag, JavaScript returns only the first match; enable g to list all matches.
How do I reference capture groups in Replace?
Use JavaScript replacement syntax like $1, $2, or $& (whole match).
What does the Split limit do?
It limits the number of parts returned by split; leave it empty for no limit.
Why is my pattern showing “Invalid RegExp”?
The pattern or flags are not valid for JavaScript; remove unsupported flags or fix escaping (e.g., use \\ inside character escapes).