Find and Replace
Replace every match in pasted text, using an exact search or a JavaScript regular expression. Start with literal matching for ordinary edits; use Regex only when you need a pattern. Replacement text has special dollar-sign rules even when Regex is off, so inspect a small sample before applying a large edit.
Before you copy the result
- All matches are replaced, including matches inside longer words.
- Regex patterns omit / delimiters; Ignore case is optional.
- Use $$ in replacement text for a literal dollar sign.
How to use the Find and Replace
- Paste text and enter Find; output updates as you type. An empty Find returns the input unchanged.
- Leave Regex off to search punctuation literally. Enable Ignore case to match different capitalization.
- Leave Replace with empty to delete matches. With Regex on, enter the pattern without surrounding slashes; all matches are replaced.
Choose a safe search boundary
Replacing a short fragment can alter longer words, filenames and identifiers. For simple English whole words use Regex with \bcat\b; JavaScript word boundaries are not a general word detector for every writing system. Compare the beginning, middle and end of the result before copying.
The tool uses global matching and optionally case-insensitive matching. It exposes no multiline, dot-all or Unicode flags. A dot does not normally span a newline; ^ and $ do not automatically match every line. Invalid expressions display an error. Avoid complex patterns on large input because expensive matching can stall the browser.
Replacement text is also syntax
$& inserts the matched text, $1 inserts the first captured group when one exists, and $$ inserts a dollar sign. Literal search escapes the Find pattern only; it does not disable replacement tokens. To surround each match with brackets, use [$&]. Keep an original copy because the output has no edit history.
Examples
Deletion without losing the original
Input “ID: 42; ID: 17”, Find “ID: ” and an empty replacement produce “42; 17”. Inspect separators before copying; deleting a label does not parse or validate the remaining values.
Substring replacement
Input “cat scatter CAT”, Find “cat”, Replace with “dog”: default output is “dog sdogter CAT”. Ignore case changes the last word too: “dog sdogter dog”. Matching is not restricted to whole words.
Capture and reorder
Enable Regex. Input “2026-10-30”, Find “(\d{4})-(\d{2})-(\d{2})”, replacement “$3/$2/$1” produces “30/10/2026”. The three captured groups supply day, month and year; this reformats text without validating a date.
Literal dots and dollars
With Regex off, input “a.b aXb” and Find “a.b” match only the first token. Replacement “$$5” produces “$5 aXb”: two dollar signs in the replacement insert one literal dollar sign.
Regex patterns with the available flags
| Find | Replacement | Actual scope |
|---|---|---|
| \s{2,} | Runs of two or more whitespace characters, including line breaks | |
| ^\s+|\s+$ | (empty) | Whitespace at the start or end of the entire input |
| \bcat\b | dog | Simple whole-word matches, case-sensitive unless Ignore case is on |
Enable Regex for these patterns. The tool has no multiline flag; anchors do not trim every line.
Frequently asked questions
Can I replace just the first occurrence?
There is no first-only switch: matching is global. Narrow the input or choose a pattern that matches only the intended occurrence.
Why did $& appear as the original word?
The replacement field interprets $& as the entire match in both literal and Regex modes. Enter $$& if you need the literal characters $&.
Does an invalid pattern alter my input?
An invalid Regex pattern produces an error and empty output. The pasted input remains available for correction.
Sources & methodology
More text tools
Case Converter
Convert text between title, sentence, upper, lower, camel, Pascal, snake and kebab case.
Open tool →Duplicate Line Remover
Remove duplicate lines while optionally ignoring letter case and blank lines.
Open tool →Line Sorter
Sort lines alphabetically, numerically or by length.
Open tool →Remove Line Breaks
Remove or replace line breaks and normalize whitespace.
Open tool →Text Diff Checker
Compare two text blocks and identify line changes.
Open tool →Text Reverser
Reverse characters, words, individual words or lines.
Open tool →