Free text tools — updated for 2025 | All Text Tools

Regular Expression Tester

Test regex patterns in real time. See match highlights, capture groups, indices, and test replacements — all in your browser.

Regex Tester
/ /

Regex quick reference

TokenMeaningTokenMeaning
.Any char except newline\dDigit [0–9]
^Start of string / line (m)\DNon-digit
$End of string / line (m)\wWord char [a-zA-Z0-9_]
*0 or more (greedy)\WNon-word char
+1 or more (greedy)\sWhitespace
?0 or 1 (or lazy quantifier)\SNon-whitespace
{n,m}Between n and m times\bWord boundary
[abc]Character class\BNon-word boundary
[^abc]Negated character class(?:…)Non-capturing group
(abc)Capturing group(?=…)Positive lookahead
a|bAlternation (a or b)(?!…)Negative lookahead
(?<name>…)Named capture group\1, \2Back-reference

Frequently Asked Questions

This tester uses JavaScript's built-in RegExp engine — the same engine that runs in every browser and Node.js. It supports all ECMAScript 2024 regex features including named capture groups ((?<name>…)), lookaheads, lookbehinds, Unicode property escapes (\p{L} with the u flag), and the d flag for match indices. Most patterns from PCRE and Python re work here, with minor syntax differences.
g (global) — find all matches instead of stopping at the first. i (case-insensitive) — abc matches "ABC", "Abc", etc. m (multiline) — ^ and $ match the start/end of each line, not just the whole string. s (dotAll) — makes . match newline characters too. u (unicode) — treat the pattern as a sequence of Unicode code points and enable Unicode property escapes like \p{Emoji}.
In the Replace tab, use $1, $2… to reference numbered capture groups. Use $<name> for named groups. Use $& to insert the full matched string, and $$ for a literal dollar sign. For example, if your pattern is (\w+)\s(\w+) (first and last name), the replacement $2, $1 would reorder them to "Last, First".
The most common causes: (1) Forgetting to escape special characters — in regex, . matches any character, not a literal dot. Use \. for a literal dot. (2) Using + or * greedily when you want lazy — add ? after: .*? matches as few characters as possible. (3) Anchors — without ^ and $, your pattern can match anywhere inside a string. (4) The g flag — without it, only the first match is returned.