Find and Replace Text: Online Tool
Text Tools
Find and replace text online with optional case-sensitive or whole-word matching, plus a separate JavaScript regex mode. Paste text and replace all matches.
3 matches found
Find and Replace
Paste or type your text and replace all matching occurrences. Plain-text search is the default, with optional case-sensitive and whole-word matching; select Regex mode to use a JavaScript pattern instead.
Options
- Case sensitive: treats uppercase and lowercase as distinct.
- Whole word: only matches the exact word, not substrings. This option is
disabled in Regex mode; add
\bboundaries to your pattern instead. - Regex mode: the find field is treated as a JavaScript regular expression.
Capture groups work in the replacement (e.g.,
$1).
Regex mode guide
In regex mode, capture groups let you rearrange and transform text. Use parentheses to capture parts of the match and reference them in the replacement string:
-
Find: (\d4)-(\d2)-(\d2)— captures a date in YYYY-MM-DD format Replace: $2/$3/$1— reformats it as MM/DD/YYYY
Regex mode uses JavaScript regular expressions with a global g flag and adds
i unless Case sensitive is enabled. It does not enable multiline m or
dotAll s: ^ and $ use whole-text anchors instead of matching
each line, and . does not match line breaks.
Common regex patterns
| Pattern | Matches | Example |
|---|---|---|
\d+ | One or more digits | 42, 1000 |
\s+ | One or more whitespace characters | spaces, tabs |
[A-Z] | Any uppercase letter | A, B, Z |
^line | "line" at the start of the entire text | line 1, if the text starts with it |
\bword\b | Whole word boundary | "word" not "sword" |
(foo|bar) | Either "foo" or "bar" | foo, bar |
Use cases
- Bulk variable renaming: rename a variable throughout a code snippet without affecting partial matches.
- Date format normalization: convert between ISO dates, US dates, and European dates using capture groups.
- Whitespace cleanup: replace multiple spaces with a single space, or strip trailing spaces from each line.
- Markdown cleanup: remove or replace specific formatting patterns across a long document.
Privacy
All processing is done locally in your browser. Your text is never sent to a server.
Related tools
- Whitespace CleanerUse Whitespace Cleaner to clean up whitespace in text: trim lines, collapse.
- Remove DuplicatesUse Remove Duplicates to remove duplicate lines from text instantly. Case-sensitive or.
- Sort LinesUse Sort Lines to sort lines of text alphabetically, numerically, by length,.
- Text DiffUse Text Diff to compare two texts side by side or in.
- Case ConverterNormalize casing after replacing names, labels, or identifiers across your text.