DevKit
Converter

Find & Replace

Find and replace text with optional regex and case-insensitive matching.

Last updated: August 2026

Share:

Was this tool helpful?

Find and replace, with and without regex

Find and replace swaps every occurrence of a search term for a replacement. In plain mode the search is a literal string. Switch on regular expressions and the search becomes a pattern, which unlocks wildcards, anchors, and capture groups you can reference in the replacement. The case-insensitive toggle decides whether Error matches error.

When regex is worth it

Literal replace is right for a simple rename. Regex earns its keep when the target varies: strip all trailing whitespace, reformat a batch of dates, or wrap every number in quotes. Capture groups let you rearrange text, for example turning Last, First into First Last.

Example

Pattern:     (\w+), (\w+)
Replacement: $2 $1
Input:       Lovelace, Ada
Output:      Ada Lovelace

Here $1 and $2 refer to the first and second captured groups. Some engines write them as \\1 and \\2 instead, which is a common portability snag.

Pitfalls that bite

Forgetting the global flag replaces only the first match. Special characters in a literal search, like a dot or a plus, are treated as regex metacharacters once regex mode is on, so 3.14 would match 3x14 unless you escape the dot. And a greedy quantifier can swallow more than you expect, matching from the first opening tag to the last closing one across the whole document.

FAQ

Why did only the first match change? The global flag was off. Replace runs once without it.

My replacement text shows $1 literally, why? Group references only work in regex mode. In literal mode the dollar sign is just a character. For building and testing patterns in isolation, use the regex tester.

How do I replace a literal dollar sign in regex mode? Escape it in the replacement, usually by writing $$.