Skip to main content

Find & Replace — Plain Text and Regex

Paste text, type what to find and what to replace it with, and copy the result. Plain mode treats your search as literal text — dots, brackets, and dollar signs mean themselves. Regex mode unlocks patterns and $1-style capture-group replacement, with invalid patterns explained inline instead of silently matching nothing.

Result

Enter text and something to find; the replaced version appears here.

Use the cleaned text in Moda

Paste your bulk-edited copy straight into a document, deck, or design and keep working on it.

Try Moda free →

Plain mode is genuinely literal

Many online replacers quietly run every search as a regex, so searching for "$1.50" or "C++" matches nothing or the wrong thing. Here, plain mode escapes everything: "a.b" matches only the three characters a-dot-b, and a replacement containing "$" stays a dollar sign instead of being read as a group reference. If you did not choose regex mode, no character in either box has special meaning.

Capture groups in regex mode

Parentheses in the pattern capture text you can reuse in the replacement: pattern (\w+)@old\.com with replacement [email protected] rewrites every address while keeping the username. Named groups work too — (?<user>\w+) is $<user> in the replacement. The regex dialect is JavaScript’s, with the Unicode flag always on, so \d, \b, lookaheads, and lookbehinds behave as they do in a browser console — and a pattern error appears in red under the input the moment the pattern stops parsing.

The match count and the two toggles

The count above the result shows how many matches the current pattern finds before replacement — a quick sanity check that a regex does what you meant before you copy anything. "Replace all" off means only the first match is replaced, useful for changing one heading without touching the body. Case sensitivity is off by default because most prose edits want "The" and "the" treated alike; turn it on for identifiers and code.

Frequently asked questions

How do I replace with a captured group?

Switch to regex mode, capture with parentheses, and reference the group as $1, $2, … in the replacement — e.g. pattern "(\d+)px" with replacement "$1rem". Named groups use $<name>. In plain mode $1 is just text.

Why does my pattern show a red error?

The pattern is not valid JavaScript regex — an unclosed group or bracket is the usual cause, and the message is the parser’s own explanation. The result stays at your last valid state; nothing is replaced until the pattern parses.

How do I replace line breaks?

Use regex mode: \n matches a line break, so pattern "\n" with a space as the replacement joins lines, and "\n{2,}" collapses multiple blank lines into one. Windows-style \r\n can be matched with "\r?\n".

Is there a length limit, and does the text leave my browser?

Input is capped at 200,000 characters — beyond that the tool asks you to split the text rather than risk freezing the tab on an expensive pattern. Nothing is uploaded either way: matching and replacement run locally, so logs, exports, and private drafts are safe here.

Does this tool execute my regex as code?

No. The pattern is compiled by the browser’s regex engine only — nothing you type is ever evaluated as code, and a catastrophic pattern at worst slows your own tab.

Related tools

← All tools