Regex Tester
- Write the pattern, without the delimiting slashes.
- Enable the flags you need: g, i, m, s, u or y.
- Paste your test text. Matches appear in real time, with the position of each one and the captured groups.
- If the pattern has a syntax error, the tool says so rather than trying to interpret it.
- g searches for every occurrence, not just the first.
- i ignores case.
- m makes ^ and $ match the start and end of each line, not of the whole text.
- s makes the dot match line breaks too.
- u enables Unicode mode, required for \p{...} and for handling emoji correctly.
- y anchors the search at exactly the current position, without scanning forward.
Parentheses create a captured group, numbered left to right. They appear in the group list for each match.
Named groups use the (?<name>...) form and stay far more readable as the pattern grows, especially when extracting a date, an amount or an identifier from structured text.
If you only need grouping to apply a quantifier, without keeping the result, use (?:...). That avoids useless captures and keeps the expression faster.
Nested quantifiers such as (a+)+ can trigger catastrophic backtracking: on input that does not match, the engine tries an explosive number of combinations and hangs. That is the basis of the attacks known as ReDoS.
This tool stops scanning after 10,000 matches, which protects the interface but is no substitute for writing a well-formed pattern.
Patterns matching the empty string get special handling to avoid an infinite loop, with the cursor advancing manually when that happens.
This tester uses the JavaScript regular expression engine. PCRE, Python and Go syntax may diverge, particularly on lookbehind and Unicode classes.
Frequently asked questions
No. Type only the pattern. Flags are chosen separately, not appended at the end of the expression.
Because each language uses a different engine. JavaScript does not support some PCRE constructs, and the behaviour of lookbehind and Unicode classes varies considerably between implementations.
A captured group, with (...), keeps the matched text for later use. A non-captured one, with (?:...), only groups so you can apply a quantifier or alternation, keeping nothing.
It is a protective limit. Very open patterns over large texts would produce too many results and freeze the page.
No. The pattern and the text are processed in your browser and nothing is logged.