Stays in your browser
Find and Replace Online
Free find and replace tool with plain text or regex bulk replacement.
Find and replace without surprises
Literal replace is safe but limited. Regex replace is powerful and destructive: an unanchored pattern rewrites substrings you did not mean to touch, and a backreference silently produces nothing when the group did not participate in the match.
Test before you replace. Run the pattern as a match first and confirm it selects exactly the intended text, including the case where it should select nothing. A pattern that matches more than expected is far cheaper to fix before the replacement than after it has rewritten a file.
Two escapes cause most accidents. A dot matches any character, so version.1 also matches version21, and a dollar sign in the replacement is a group reference rather than a literal dollar. Anchoring with a caret or a word boundary turns most accidental rewrites into no-ops.
FAQ
- How does regex mode work?
- Enable Regex and use JavaScript RegExp syntax.
- Case sensitivity?
- Toggle it on or off for matching.
- Uploaded?
- No.
- How do I use capture groups in the replacement?
- Wrap the part you want to keep in parentheses and refer to it in the replacement as $1, $2 and so on. The captured text is inserted verbatim, so a group that matched nothing leaves a gap rather than an error, which is worth checking on a sample before applying it everywhere.
- Why did my replacement change more than expected?
- The usual cause is an unescaped dot or a missing anchor. A dot matches any single character, so a pattern meant for version.1 also matches version21, and without a caret or word boundary the match can start anywhere in the line. Escape the dot and anchor the pattern.
- Can find and replace work across multiple lines?
- Only with an explicit multi-line mode, since the default treats the text one line at a time. Without it, a pattern that appears to span lines matches nothing at all, which is the more common symptom than an over-broad match.