Regex Tester
Test regular expressions with highlighted matches, group table, replace preview and a plain-English explanation. Includes Indian PAN and GSTIN patterns.
Test text
Stays in your browserMatches (2)
Born 1815-12-10, died 1852-11-27.
| # | Match | Position | Groups |
|---|---|---|---|
| 1 | 1815-12-10 | 5–15 | year: 1815month: 12day: 10 |
| 2 | 1852-11-27 | 22–32 | year: 1852month: 11day: 27 |
What the pattern means
\b | a word boundary |
(?<year> | start of the group named year |
\d | a digit (0-9) |
{4} | exactly 4 times |
) | end of group |
- | the text "-" |
(?<month> | start of the group named month |
0 | the text "0" |
[1-9] | any one of 1-9 |
| | or |
1 | the text "1" |
[0-2] | any one of 0-2 |
) | end of group |
- | the text "-" |
(?<day> | start of the group named day |
0 | the text "0" |
[1-9] | any one of 1-9 |
| | or |
[12] | any one of 12 |
\d | a digit (0-9) |
| | or |
3 | the text "3" |
[01] | any one of 01 |
) | end of group |
\b | a word boundary |
Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)
Next steps
Done here? Use the Send to… menu on the result to carry it on to String Replacer / List Compare or Text Compare.
Free Online Regex Tester and Explainer
Type a pattern and some text and see every match, group and position at once. Each part of the pattern is explained in plain English, and there is a library of common and Indian patterns. It gives developers a quick browser-based way to solve a focused regex tester task before moving the result into a project.
How to test a regular expression
Enter the pattern without slashes, tick the flags you need and type or paste the text to test. Matches are highlighted as you type, the table lists each match with its groups and position, and "Replace preview" shows the result of a replacement such as $2-$1.
Patterns for India
The library has PAN, GSTIN, IFSC, PIN code, +91 mobile, Aadhaar (format only) and vehicle number patterns. They check the shape of a value, not whether it exists. Never paste real Aadhaar numbers.
Common mistakes
- Without the
gflag only the first match is found. .does not match a new line unless thesflag is on.- Special characters such as
.?+and(need a backslash to match themselves.