Regex tester & explainer
Regex Tester and Explanation Tool
JavaScript regular expressions only. Everything runs locally in your browser.
Performance (estimate)
—Run time
—
Text
106 chars
Matches
0
Flags
giu
Enter a valid pattern and some text to measure.
Active: giu
Tip: use g to see all matches; remove it to see just the first.
Max 500 matches rendered to keep things fast.
Finds all matches. Looks for a match inside the input using JavaScript regex.
Breakdown
Quick tips
- Use ^ and $ to validate the whole string.
- Turn on g to see every match in the text.
- Prefer [\\s\\S] if you need “any character” without relying on dotAll.
Common recipes
- \\d+ — one or more digits
- \\b\\w+\\b — whole words
- ^\\S+$ — non-empty, no spaces
- ^(a+)+$ — slow example (backtracking)
Privacy & engine
This tool runs entirely in your browser using the JavaScript regex engine. Your text and patterns are not sent to a server.
If you’re comparing against PCRE/.NET/RE2, behavior can differ (especially around lookbehinds, Unicode, and backtracking).
How it works
The tester compiles your pattern with the JS RegExp engine, runs it in a web worker, and streams matches plus a plain-language breakdown of each token.
- Highlights, groups, flags, and JSON output come from the same run so they stay in sync.
- Unsupported flags are disabled automatically; sticky and indices depend on your browser engine.
Quick examples
Use lazy quantifiers like *? to keep matches tight when text is long.
Mini FAQ
Does it support lookbehind?
Yes in modern browsers; older ones may fail to compile patterns with ?<= or ?<!.
Why do matches stop?
Rendering caps at 500 results to keep the UI responsive.
How do ^ and $ behave?
Without m they anchor the whole text; with m they anchor each line.
Related tools