Regex Tester
Test patterns with live highlighting
Matches
2- 1. help@nol.so @0
- 2. ad@example.co.kr @13
Do this with a friend
Watch the same screen together, live
About this tool
This tool tests a regex pattern against text in real time. Because it runs the browser's actual JavaScript regex engine, whatever pattern you confirm here behaves the same when you paste it into code โ matches are highlighted, and capture groups are listed alongside each match. For example, the email preset that is on by default (pattern [\w.+-]+@[\w-]+\.[\w.]+, test string "help@nol.so, ad@example.co.kr") finds both addresses and reports 2 matches. It shows the match count, each match's position (@index), and any capture group values from parentheses in one place, which is handy for a final check before dropping a pattern into code. The four flag toggles on screen โ g, i, m, s โ are the only ones exposed though, so patterns that need u (unicode) or y (sticky) may behave differently in your actual code than what you see here.
How to use
- Click a common-pattern button (email, Korean phone number, URL, date, and more) to start from an example, or type your own pattern.
- Toggle the g (global), i (ignore case), m (multiline), and s (dotAll) flags with the buttons.
- Type the string to test in the box below and matching parts are highlighted.
- In the match list, check each match's position (@index) and its capture group values.
- If the pattern is invalid, a red error box shows the exact message from the JavaScript engine.
- Check the badge next to the match results for the total number of matches.
Frequently asked questions
- Which regex flags does this support?
- You can toggle four: g (global search), i (case-insensitive), m (multiline, so ^ and $ work per line), and s (dotAll, so . also matches newlines). Flags like u (unicode) or y (sticky) are not exposed as toggles here.
- Why do I still see multiple matches even with the g button off?
- This tool always searches internally with the g flag on so it can find every match position. The on-screen g button is meant to record which flag combination you'd use in your actual code โ toggling it does not change the match results shown here.
- How do I check capture groups?
- If your pattern has parenthesized groups, each match in the list shows its group values in order. A group that did not match is shown as 'none'.
- Does entering very long text slow things down?
- No โ to avoid an infinite loop from a pattern that keeps matching an empty string, the search stops after at most 1000 matches.
- What changes when I click a preset button?
- The pattern, flags, and test string all switch to the example values together. Clicking the email preset, for instance, sets the pattern to [\w.+-]+@[\w-]+\.[\w.]+ and the test string to "help@nol.so, ad@example.co.kr", highlighting both addresses.
- What happens when there are no matches?
- The text shows as plain, unhighlighted text, and the match badge reads 0.
- What happens if I paste in text with a huge number of matches?
- To guard against patterns that could match forever, such as one that keeps matching an empty string, the search stops after at most 1,000 matches, and the list only shows the first 30 of them.
- Can I use a pattern confirmed here as-is in another language like Python?
- Mostly, but not always exactly. This tool runs the actual JavaScript regex engine, so things like lookbehind support or escaping rules can behave differently in other languages.