Test a regular expression against your own text and see every match highlighted instantly, together with the captured groups and a plain-language explanation of the pattern. It uses the JavaScript regular expression engine of your browser, and your text never leaves your device.
Good to know
A regular expression describes a pattern of text. The tester runs your pattern with the JavaScript regex engine, highlights every match and shows what each capturing group matched, so you can adjust it until it behaves as intended.
Flags change how a pattern is applied: g finds every match, i ignores case, m makes ^ and $ work per line, s lets the dot match line breaks and u enables full Unicode matching.
When to use it
- Building a pattern to validate or extract text such as dates, codes or identifiers.
- Debugging why a pattern matches too much or too little.
- Learning regex by seeing each match highlighted live.
Example: Extracting parts of a date
Input
Pattern: (\d{4})-(\d{2})-(\d{2})
Text: Released on 2026-11-01.Result
Match: 2026-11-01
Group 1: 2026 Group 2: 11 Group 3: 01
Common mistakes
- Forgetting the g flag and getting only the first match.
- Using . to mean a dot. A dot matches any character, so escape it as \. for a literal dot.
- Greedy quantifiers that match too much, such as .* between two tags. Use the lazy form .*? instead.
- Nested quantifiers such as (a+)+ that can cause catastrophic slowdowns on some input.
Frequently asked questions
- Which regular expression syntax does it use?
- The JavaScript RegExp engine of your browser. Patterns written for PCRE, Python or Java can behave differently, and features such as atomic groups or possessive quantifiers are not available.
- What do the flags mean?
- g finds all matches, i ignores case, m makes ^ and $ match at each line, s lets the dot match line breaks, u turns on Unicode mode, and y matches only at the exact position where the search starts.
- Why do I get only one match?
- Without the Global (g) flag, only the first match is returned. Tick Global to find all matches.
- Are there limits?
- The pattern can be up to 500 characters, the test text up to 20,000 characters, and at most 1,000 matches are listed. This keeps your browser responsive.
- Why does the page become slow with some patterns?
- Patterns with nested repetition such as (a+)+$ can take extremely long on long text, which is called catastrophic backtracking. Simplify the pattern if the page seems to hang.
- Is my text sent to a server?
- No. The test runs entirely in your browser.
Related searches: test regular expression online with match highlighting · javascript regex tester with explanation · regex tester with capture groups · regex101 alternative
Tìm kiếm liên quan: công cụ kiểm tra biểu thức chính quy online · test regex javascript có tô sáng kết quả · giải thích cú pháp regex · kiểm tra regex có nhóm bắt capture group