UTILYARD
tools / text

Find and Replace

Find and replace text with regex and case-sensitivity options.

source text

About Find and Replace

Search for any text pattern and replace occurrences instantly. Supports plain text, case-sensitive matching, whole word boundaries, and full JavaScript regular expressions.

FAQ

Can I use regular expressions?
Yes. Check the Regex option and enter any valid JavaScript regular expression as the find term.
What does whole word matching do?
Whole word mode only matches the search term when it appears as a standalone word, not as part of a longer word.
Does replace preserve case?
Replacements use the exact string you enter in the Replace field. Case is not automatically preserved.

ABOUT THIS TOOL

Enter a search term and a replacement, paste in your text, and every matching instance gets swapped instantly, with optional case-sensitive matching and full regular expression support for more advanced patterns. Regex mode lets you match patterns like any digit, whitespace runs, or repeated characters instead of just literal text, which is useful for cleaning up inconsistent formatting in bulk. Writers use it to rename a character or term throughout a manuscript, developers use it to reformat data or swap variable names in a snippet, and anyone with a repetitive editing task can skip opening a full text editor. Because replacements happen live, you can adjust your search pattern and immediately see how many matches change across the whole text.

HOW TO USE

  1. Paste the text you want to edit into the input box.
  2. Type the term or pattern you want to find.
  3. Type the replacement text.
  4. Toggle case-sensitive matching or regex mode if needed.
  5. Review the updated text and copy the result.

COMMON USE CASES

  • A novelist renaming a character throughout an entire manuscript draft
  • A developer swapping an old variable or function name across a pasted code snippet
  • Someone standardizing inconsistent date formats in a spreadsheet export using a regex pattern
  • An editor removing extra spaces or fixing recurring typos across a document
  • A marketer updating a product name consistently across old copy before reposting it

TIPS & COMMON MISTAKES

  • Without regex mode enabled, special characters like periods or parentheses in your search term are treated literally, not as pattern symbols
  • Case-sensitive mode means 'Apple' and 'apple' are treated as different searches, turn it off if you want to catch both
  • In regex mode, remember to escape characters that have special meaning, like a literal period, or your pattern may match more than intended
  • Test your pattern on a small sample first when using regex, since a too-broad pattern can replace text you didn't mean to touch

MORE QUESTIONS

What happens if my search term appears inside a longer word?
Without a word-boundary regex pattern, a plain text search matches the substring wherever it appears, so searching 'cat' would also match inside 'category' unless you use regex boundaries to restrict it.
Can I use capture groups to reorder matched text in regex mode?
If the tool supports standard regex replacement syntax, you can typically reference captured groups in the replacement field to rearrange or reuse parts of the match, similar to most programming language regex engines.
Does find and replace work across multiple lines?
Yes, since the whole pasted text is searched as one block, matches spanning different lines are found the same way as matches within a single line, though multiline-specific regex patterns may need the appropriate flag.
Why didn't my case-sensitive search find an obvious match?
If the casing in your search term doesn't exactly match the casing in the text and case-sensitive mode is on, the match is skipped entirely, double-check capitalization or switch the toggle off.

RELATED GUIDES

How to Find and Replace Text
How find and replace works, when to use regex, case sensitivity, common patterns, and tips for bulk text editing.
Read →
Find and Replace — UtilYard