Content and text
Regex Find and Replace
Find and replace text with a regular expression, and see every match with its line number.
Runs in your browser; nothing is uploaded. · Free, no account · 3 min
Use $1, $2 for groups, $& for the whole match. Leave empty to delete matches.
Importing a saved run into your account is coming soon. Until then, your last runs stay in this browser only, and you can download your files.
How to use
- Paste the text to search.
- Type a regular expression in Find and the replacement, using $1, $2 for groups and $& for the whole match.
- Set the flags: every match, ignore case, line anchors, dot matches line breaks, Unicode.
- Check the match table, then copy the replaced text.
What it checks and how it works
The tool runs JavaScript's own regular expression engine, as documented on MDN, and applies String.replace with your replacement pattern. Unicode mode is on by default so that Arabic letters and emoji count as single characters. The match table lists up to 200 matches with their line numbers and capture groups. Plain text mode escapes your pattern so symbols such as . and ( are matched literally.
JavaScript syntax differs from PCRE and Python: there are no possessive quantifiers or inline comments, and lookbehind support depends on your browser. A pattern that repeats a repeated group, such as (a+)+, can make the page slow on some text, so the tool warns about that shape. Input is limited to 500,000 characters.
Sources
- MDN: Regular expressions (JavaScript) opened 29 Oct 2026
- MDN: String.prototype.replace, replacement patterns opened 29 Oct 2026
Related tools
Remove Duplicate Lines, Sort and Clean a List
Remove duplicates and empty lines, trim spaces and sort a list in one pass.
Text Diff Checker
Paste two versions of a text and see exactly what was added and removed.
Case Converter
Turn a phrase into any naming or writing case, one line or many at a time.
URL Parameter Stripper
Remove tracking parameters from a list of URLs, and see what was removed from each one.
Questions
About this tool
Wrap the part in parentheses and write $1 for group one, $2 for group two, and $& for the whole match.
This tool uses JavaScript's regular expression syntax, which differs from PCRE, Python and other flavors. Named groups and lookahead work, but possessive quantifiers and inline comments do not.
Yes. Keep Unicode mode on and use a range such as [\u0621-\u064A], or the property escape \p{Script=Arabic}, which needs the u flag.
Get started today
Find out where your brand stands in AI. Free.
Run a free AI visibility analysis on your domain. No credit card, results in minutes. See what AI engines say about your brand today.
Brands already measuring their AI visibility with Zaher.


