Skip to content
Zesona
Regex Find and ReplaceLocal

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

Runs in your browser

0 characters

Processed entirely in your browser. Nothing is uploaded.

JavaScript regular expression syntax.

amp; is the whole match, $1 the first group, $ a literal dollar sign.

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. 1

    Paste your text and enter a pattern.

  2. 2

    Check the match table before relying on the replacement: it shows each match, its position and its capture groups.

  3. 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.

Other tools you might reach for next.

Compare two texts line by line with a longest-common-subsequence diff, the same approach git uses.

BrowserText tools

Count words, characters, sentences, paragraphs and UTF-8 size, with all three definitions of "character" reported separately.

BrowserText tools

Count characters three ways - UTF-16 code units, Unicode code points and visible grapheme clusters - plus the UTF-8 byte size.

BrowserText tools

Count sentences using Unicode sentence segmentation, which handles abbreviations better than splitting on full stops.

BrowserText tools

Count paragraphs, treating one or more blank lines as the separator, plus words, sentences and lines.

BrowserText tools