Regex Tester
Test JavaScript regular expressions against text, see every match and group, and preview replacements.
- Privacy
- This tool runs in your browser. Nothing you enter is sent to Wayfind.
- Filed under
- Filed under
Test JavaScript regular expressions against text, see every match and group, and preview replacements.
JavaScript (ECMAScript), as your browser runs it: lookahead and lookbehind, named groups, Unicode property escapes with the u or v flag, and set operations with the v flag. Features of other engines, such as possessive quantifiers or recursion, are not available.
Each run gets 2 seconds in a separate worker. Patterns with nested quantifiers, such as (a+)+$, can take exponential time on text that almost matches, so the run is stopped instead of freezing the page. Rewrite the pattern so each part of the text can match in only one way.
They follow JavaScript's rules: $1 to $99 insert numbered groups, $<name> a named group, $& the whole match, $` and $' the text before and after it, and $$ a dollar sign. Without the g flag, only the first match is replaced.
g finds every match instead of only the first, i ignores letter case, m makes ^ and $ match at the start and end of each line, s lets . match line breaks, u reads the pattern as Unicode (an emoji is one character and \p{…} classes work), v adds set operations to classes and cannot be combined with u, and y makes each match start exactly where the previous one ended.
No. The expression runs in a worker in this browser tab, and neither the expression nor the text leaves your device.