Find and replace text literally, with optional case-insensitive and whole-word matching.
Regex Find and Replace
Find and replace with JavaScript regular expressions, showing every match and its capture groups.
- Free
- No sign-up
- Runs in your browser
Input
0 characters
Processed entirely in your browser. Nothing is uploaded.
JavaScript regular expression syntax.
i ignore case, m multiline anchors, s dot matches newline, u unicode. The g flag is always on.
Try an example
Fill in Your text and Pattern to continue.
Enter your input to see the result
Everything happens on this device. No upload, no account, no network request.
How to use this tool
- 1
Paste your text and enter a pattern.
- 2
Check the match table before relying on the replacement: it shows each match, its position and its capture groups.
- 3
Use $1, $2 in the replacement to reinsert captured groups.
Questions about Regex Find and Replace
Which regex flavour is this?
The JavaScript engine built into your browser. It supports lookahead, lookbehind, named groups and Unicode property escapes, but it is not PCRE: there is no recursion, no atomic grouping and no possessive quantifier. Patterns written for Perl or PHP may need adjusting.
Why was my pattern rejected?
Either it is not valid JavaScript regex syntax - the error message quotes the engine’s own explanation - or it can match the empty string. A pattern like a* matches nothing successfully at every position, which would insert the replacement between every character, so the tool refuses it and suggests using + instead.
Is my text uploaded anywhere?
No. This tool runs as JavaScript inside your browser tab. There is no network request carrying your text, nothing is written to a server log, and the tool keeps working with your connection switched off. You can confirm it yourself in the browser’s network panel.
Does the Regex Find and Replace work offline?
Yes. Once the page has loaded it runs entirely as JavaScript on your own device, so the Regex Find and Replace keeps working with the network switched off and nothing is ever sent to a server.
Is anything I enter into the Regex Find and Replace uploaded or stored?
No. The Regex Find and Replace runs in your browser, so whatever you type or paste never leaves your device — there is no server round-trip, nothing is logged, and there is nothing to delete afterwards.
Related tools
Other tools you might reach for next.
Compare two texts line by line with a longest-common-subsequence diff, the same approach git uses.
Compare two documents in a side-by-side aligned view with additions, removals and unchanged lines marked.
Count words, characters, sentences, paragraphs and UTF-8 size, with all three definitions of "character" reported separately.
Count characters three ways - UTF-16 code units, Unicode code points and visible grapheme clusters - plus the UTF-8 byte size.
Count sentences using Unicode sentence segmentation, which handles abbreviations better than splitting on full stops.
Count paragraphs, treating one or more blank lines as the separator, plus words, sentences and lines.
Estimate silent reading time from the word count, with the research-backed default rate stated and adjustable.