Toolify

Find and Replace Text (literal or regex, with options)

Paste text, set find and replace strings, optionally enable regex / case-insensitive / multi-line, and see the modified text plus match count instantly.

Result (0 matches)
 

How it works

Two modes — literal and regex

Literal (regex off): the find string is matched exactly. Special characters like '.' and '*' are treated as themselves. This is the safe default for most everyday text edits.

Regex (regex on): the find string is interpreted as a JavaScript regular expression. Use this for patterns — for example /\b\w+@\w+\.\w+\b/ to find emails, or (^.+:) to match labels at the start of a line. With multi-line mode, ^ and $ match at line breaks.

Replace string special syntax

When in regex mode, the replace string supports backreferences: $1, $2 etc. for capture groups; $& for the entire match; $$ for a literal dollar sign. Example: find /(\d{3})-(\d{3})-(\d{4})/ replace ($1) $2-$3 reformats US phone numbers.

In literal mode, the replace string is taken as-is — no backreferences, no special handling. What you type is what gets inserted.

Common uses

Bulk edit: standardize spelling ('color' → 'colour' for UK style), update product names, fix typos in long documents.

Code refactoring: rename a variable across a paste of code (use case-sensitive). For real refactoring across many files, an IDE is better.

Data cleanup: convert tabs to commas in CSV, replace one delimiter with another, normalize whitespace.

Markdown to plain: strip Markdown syntax with regex (e.g., /\*\*([^*]+)\*\*/g → $1 to remove bold markers).

Frequently asked questions

How is this different from the regex tester?

This focuses on the replace operation. The regex tester focuses on inspecting matches and capture groups. Use whichever fits the task.

Can I use Unicode in the find/replace?

Yes. Both find and replace strings support full UTF-8 including emoji and CJK characters.

Why didn't my find/replace work?

Most common: case sensitivity. 'Hello' won't match 'hello' unless you toggle case-insensitive. Or special regex characters in literal mode being misunderstood.

Does this preserve formatting?

It preserves text exactly except for the matches. If your text has tabs or specific newlines, they're preserved.

Can I undo a replacement?

The original is in the input field. Re-paste from there or use your browser's back-text behavior. We don't have a built-in undo.

How big can my text be?

Multi-megabyte text works, though regex on huge inputs can be slow if the pattern is poorly written.

What's a good way to learn regex?

Start with literal mode and switch to regex when you need patterns. Search 'JavaScript regex cheat sheet' or refer to MDN's RegExp docs.

Does the data leave my browser?

No. All find/replace runs locally.

Related tools

Last updated: