Regular expression tester
Enter the pattern, flags and text to search. Matches are listed with their position.
Result
2Matches
- No. 1 (index 8)
- 2026-10-11 → 2026 | 10 | 11
- No. 2 (index 26)
- 2026-11-02 → 2026 | 11 | 02
Inputs
- Regular expression
- (\d{4})-(\d{2})-(\d{2})
- Flags
- g
- Test text
- Release 2026-10-11, patch 2026-11-02.
How it is calculated
The pattern is compiled with the browser’s JavaScript RegExp engine.
Result
Matches
- No. 1 (index 8)
- 2026-10-11 → 2026 | 10 | 11
- No. 2 (index 26)
- 2026-11-02 → 2026 | 11 | 02
How it is calculated
- The pattern is compiled with the browser’s JavaScript RegExp engine.
- Without the g flag, only the first match is searched.
- The first 20 matches are listed with their captured groups.
Example
The pattern (\d{4})-(\d{2})-(\d{2}) finds 2 dates in “Release 2026-10-11, patch 2026-11-02.”.
Good to know
- Syntax is JavaScript’s; PCRE, Python or Java differ in places.
- A badly built pattern can be very slow on long text.
When to use it
- Test a pattern on real examples before putting it in your code.
- Check a validation rule for emails, postcodes or phone numbers.
- To change the case of matched text, use the Case and slug converter.
Frequently asked questions
Why does .* catch too much?
Quantifiers are greedy: they take as much text as possible. Add ? after them, as in .*?, to take as little as possible.
Should I use a regex to check emails?
A simple pattern catches typos, but a full email rule is very complex. Sending a confirmation link is the only real check.
Can a regex be slow?
Yes. Nested quantifiers such as (a+)+ can take a very long time on some text. Keep patterns simple when they read user input.