Find & Replace
100% LocalFind and replace text with plain-text or regex patterns and flag controls.
Enter text and a search pattern. Switch between plain text and regex with case-sensitive and global flags.
Learn More
What is Find & Replace?
Frequently Asked Questions
Technical Deep Dive
Find & Replace
Perform find-and-replace operations on any text using plain string matching or full regular expressions with g/i/m flags. Preview the first 10 matches with context before applying, see a match count badge, and use the Apply button to commit changes back to the input. Supports capture group references like $1.
Built for Devs
Designed by people who use these tools in production every day.
Smart Defaults
Reasonable assumptions out of the box, every assumption overridable when you need it.
Workflow-Friendly
Pairs with your IDE, CI, and code review, output drops into commits and PRs cleanly.
01 Engine Flag Configuration
| Flag Modifier | Technical Designation | Execution Behavior |
|---|---|---|
g (Global) | Iterative Matching | Continues evaluation after first match rather than returning early. |
i (Insensitive) | Case Normalization | Ignores casing during literal and character-class comparisons. |
m (Multiline) | Boundary Redefinition | Forces ^ and $ to match line breaks rather than string edges. |
s (Dotall) | Wildcard Expansion | Permits the . wildcard to capture newline (\n) characters. |
02 Capture Group Back-References
$1, $2)
Isolate specific sub-patterns via parentheses (pattern) and re-inject them by sequence index.
$<name>)
Define logical references (?<id>pattern) for highly readable, position-independent replacements.
$&)
Re-inject the entire matched string, wrapped in new formatting or tags, without declaring explicit groups.
03 Where Find & Replace Beats an IDE
An IDE handles refactoring inside a project. Find & replace shines on the loose-text territory in between, pasted snippets, copy-from-Slack content, ad-hoc files that never made it to disk. Replacement (not matching) is the verb here; regex-tester is the place to debug the pattern itself.
-
Rename a function across a pasted file You got a code snippet in chat and need to rename
getUserDatatofetchUserProfilebefore pasting it back. Find/replace with\bword boundaries beats clicking each occurrence. -
Normalize whitespace in pasted content Collapse runs of spaces with
\s+→ single space. Strip trailing whitespace with[ \t]+$in multiline mode. Convert tabs to spaces or vice versa. -
Convert CSV delimiters Tab-separated to comma-separated, or pipe-delimited to TSV, in one paste. Handle quote-wrapped fields by writing a regex that ignores commas inside
"..."if quoting matters. -
Batch-edit markdown link references Migrate
[text](old-domain.com/path)to[text](new-domain.com/path)across a markdown document, preserving the link text and path via capture groups. -
Replace, don't just match If you only need to see what matches, use the regex tester. Find & replace is for committing the transformation, back-references, case-flipping replacements, and bulk substitutions.
04 Worked Examples
Find: (\w+)\.com
Replace: https://$1.com
Visit example.com or acme.com
↓
Visit https://example.com or https://acme.comThe captured group $1 is re-injected into the replacement. Named groups work too: (?<host>\w+).com → https://$<host>.com.
Pass 1 (case-sensitive): Foo → Bar
Pass 2 (case-sensitive): foo → barFoo bar and foo and FOO
↓ (after both passes)
Bar bar and bar and FOOA single case-insensitive replace destroys casing. Two case-sensitive passes preserve it for the common Title/lower split. FOO stays untouched here because we did not write a third pass for it, add one if needed.
Pattern: <p>.*?</p>
Flags: gs (dotall: . matches newlines)
Flags: gm (multiline: ^/$ match line edges, . does NOT cross lines)// gs flag: matches a <p> that spans multiple lines
// gm flag without s: matches only single-line <p> tagsThe s (dotall) flag changes what . matches; the m (multiline) flag changes what ^/$ match. They are independent, pick based on whether your data crosses newlines.
05 Related Tools
Find & replace is one half of the regex toolkit. These cover the other half: building, testing, and transforming text.
Regex Tester
Debug a complicated pattern with live match highlighting before pasting it into the replace field here.
Text Sorter
After a bulk replace, sort the result alphabetically, dedupe lines, or shuffle for the next pass.
String Utils
Trim, reverse, repeat, and other one-shot transformations that do not need regex at all.