Regex Tester
Test regular expressions against sample text and see every match and capture group.
Examples:
Matches
5
#1 at 6: 66
#2 at 20: 2024
#3 at 25: 01
#4 at 28: 15
#5 at 36: 3
How to use it
Type a pattern, toggle the flags you need, and paste in some sample text. Matches update as you type, with each match's position and any capture groups listed underneath. The example buttons load common starting points you can edit.
A note on safety
Your pattern is only ever compiled as a regular expression — it is never run as code. Match collection is also capped so a pathological pattern can't hang the page.
Frequently asked questions
- Which regex dialect does this use?
- JavaScript-compatible regular expressions, as implemented by your browser. Regex syntax is not identical across languages — patterns that work here may behave differently in Python, PCRE, Java, or Go, particularly around lookbehind, named groups, and Unicode escapes.
- What happens if my pattern is invalid?
- The error from the regex engine is shown and no matches are listed. The page keeps working, so you can fix the pattern and carry on.
- Why does it show matches even without the g flag?
- So the match count stays meaningful, the tester always scans the whole input. The g flag still matters when you use the pattern in your own code, which is why it's shown as a toggle.
- Is my test text sent anywhere?
- No — the pattern and text are evaluated in your browser and never leave the page.