Find and Replace

Search the input and replace matches with another string, using plain text or a regular expression.

What Find and Replace helps you do

Search pasted text for a literal string or a regular expression and replace the matches in one pass. Ignore-case and replace-all controls cover the common cleanup jobs, while capture groups handle the cases that need a pattern. It is a quick way to clean logs, rename a symbol or bulk-edit a list without opening an IDE.

Text is processed entirely in your browser. Nothing is uploaded or stored after your session.

How it works

Literal mode searches for the exact text; regex mode compiles your pattern with the selected flags. Replace all uses a global search, while replace-first stops after the first match. In regex mode the replacement supports capture groups; in literal mode with ignore-case enabled, the replacement is inserted literally so a dollar sign is not treated as a group reference.

How to use Find and Replace

  1. Paste source text, enter find and replace values, and enable regex or ignore case if needed.
  2. Choose whether to replace all matches or only the first.
  3. Review the output preview against the source.
  4. Copy or download the transformed text.

When to use it

  • Rename a variable or URL across a pasted config block.
  • Strip repeated prefixes from CSV or log lines with a regex.
  • Replace typographic quotes or stray characters before importing data.
  • Remove tracking parameters from a list of URLs.
  • Normalize a delimiter or a repeated label in pasted rows.
  • Replace a test value with a placeholder before sharing a snippet.

When not to use it

  • Do not use a broad regex on production data without testing it on a sample first.
  • Do not expect the tool to edit files in place; it works on pasted text.
  • Do not use it for structural code changes that need a parser or an IDE refactor.

Example

Replace \s+ with a single space to collapse repeated whitespace in copied web content. With replace-all on, every run of spaces, tabs and newlines becomes one space, which is useful before counting words or pasting into a single-line field.

What you can do with Find and Replace

  • Replace a literal string with another string.
  • Use JavaScript regular expressions for patterns.
  • Replace every match or only the first one.
  • Ignore case in both literal and regex modes.
  • Use capture groups such as $1 in the replacement.
  • Copy or download the transformed text.
  • Keep the original text in the input field for comparison.

Example: clean a pasted log block

Paste the log excerpt, enter the repeated prefix in Find, and leave Replace with empty to strip it. Replace all is on by default, which is usually what you want for a cleanup.

If the lines vary, switch to Regular expression and test a narrow pattern first. For example, a timestamp pattern can remove the prefix without touching message text that happens to contain digits.

Review the preview before copying. A broad pattern can remove more than intended, and the undo history lives in your editor, not in this page.

What to know before you start

  • Regular expressions use JavaScript syntax, not PCRE or another engine.
  • There is no multiline option exposed beyond what the pattern and flags support.
  • The tool does not edit files in place or keep an undo history.
  • Replacement in literal mode does not expand capture groups.
  • Very large inputs are limited by browser memory.

Common mistakes

  • Leaving replace-all on when only the first occurrence should change.
  • Using an unescaped dot in a regex and matching every character.
  • Forgetting that regex metacharacters such as ? and + are literal only in plain mode.
  • Expecting $1 to work in literal mode; it only applies to regex replacement.
  • Running a case-insensitive replacement that also changes proper nouns.
  • Replacing an empty search string and expecting no change.

Troubleshooting

If an invalid-pattern error appears, check the regex syntax. An unmatched bracket or parenthesis is the usual cause.

If nothing changes, confirm that the find field is not empty and that ignore-case is set correctly.

If the replacement inserted a dollar sign literally, that is expected in plain mode with ignore-case; switch to regex mode for group references.

If too much was replaced, reload the original text and narrow the pattern before trying again.

If the output looks identical, the find string may not be present or the case does not match.

If the replacement should keep part of the match, wrap that part in parentheses in the pattern and reference it as $1 in the replacement; plain mode cannot do this.

Related standards and documentation

  • Regular-expression syntax follows the JavaScript engine in your browser.
  • Unicode text matching may differ from older tools that use byte-oriented patterns.
Test the pattern, then replace all
  • Start with a narrow match.
  • Plain mode is literal; regex adds groups.
  • Review the preview before copying.

Frequently Asked Questions