Flags
Try
Matches
waiting for a pattern…
About this tool
- Runs in
- your browser
- Your input sent to our servers
- Nothing
- Kept on this device
- nothing
More in the privacy policy.
How to use it
- 01Type a regular expression (or paste one written as /pattern/flags), choose its flags, and paste the text to search. Or pick one under Try.
- 02Read the matches: each is marked in the text and listed with its position and its numbered and named groups.
- 03To preview a replacement, type it under Replace with, using $1 or $<name> for groups, then Copy result. Copy matches copies every match, one per line.
Related tools
Questions
Which kind of regular expressions does this test?
JavaScript's (ECMAScript), as used in browsers and Node.js, run by this browser. They support lookahead and lookbehind, named groups and Unicode property escapes such as \p{L} (with the u or v flag), but not features from other engines such as possessive quantifiers, atomic groups or recursion.
What do the flags do?
g (global: every match), i (ignore case), m (multiline: ^ and $ at line breaks), s (dotAll: . matches line breaks), u (unicode), v (unicode sets), y (sticky: only at the start (with g, each match right after the last)), d (group indices (always on here)). Without g only the first match is found.
Why was my pattern stopped?
Some patterns take exponentially long on text they almost match, for example (a+)+$ on a long run of a's followed by b: the engine tries every way to split the a's (catastrophic backtracking). Matching runs separately from the page and is stopped after 1 second, so the tab stays usable; making nested repeats more specific fixes it.
How do I use groups in the replacement?
$1, $2 … insert numbered groups, $<name> a named group, $& the whole match and $$ a dollar sign. With the dates example, $<day>/$<month>/$<year> turns "Released 2026-09-30, patched 2026-10-02." into "Released 30/09/2026, patched 02/10/2026.".
Is my text sent anywhere?
No. The pattern and the text are matched in this tab. They aren't sent to our servers, and they aren't kept after you leave the page.