🔁 Find & Replace (Regex)

Powerful browser-based find-and-replace with regex support, multiple sequential rules, live preview, and 10+ presets. Free online text editor for cleaning, formatting, and bulk transformations.

What is Find & Replace (Regex)?

A multi-rule find-and-replace tool with full JavaScript regular expression support and live preview. Stack any number of find/replace rules in sequence — each with its own regex toggle, case sensitivity, and enabled state — to build a complete text-cleaning pipeline. Capture group support means you can transform structures, not just substrings (e.g. wrap **bold** markdown into <strong> HTML, convert CamelCase to spaces, fix typos, swap date formats). Save named rule sets to localStorage for repeat workflows. 10+ built-in presets cover the most common tasks: trim lines, collapse spaces, strip HTML tags, markdown to HTML, URL extraction, and more. Inline regex error reporting prevents silent failures.

How to Use

  1. Paste your text into the top input area.
  2. Add a find/replace rule — type what to find and what to replace with. Toggle "Regex" if you need pattern matching.
  3. Add more rules to build a sequential pipeline; each rule applies to the output of the one before it.
  4. Watch the output update live with match counts per rule.
  5. Pick a preset (e.g. "Markdown bold to HTML", "Strip HTML tags") to apply a known recipe in one click.
  6. Save the rule set with a name to reuse it later — perfect for recurring text-cleaning workflows.

When to use plain text vs regex

Plain text mode is faster to type and impossible to get wrong — use it for simple substring replacements (fix a typo, change a product name, swap a brand). Regex unlocks pattern matching: anything described by a structure rather than an exact string. Need to match all email addresses? Plain text would need one rule per email; regex needs one. Need to wrap every URL in HTML anchor tags? Plain text cannot do it; regex does it in one rule with (https?://\\S+) → <a href="$1">$1</a>. The tradeoff is regex syntax: powerful, terse, and easy to get wrong. The live error display catches most mistakes before they bite.

Common regex patterns worth memorising

  • \\s+ — one or more whitespace characters (spaces, tabs, newlines)
  • \\d+ — one or more digits
  • \\w+ — one or more word characters (letters, digits, underscore)
  • ^ / $ — start / end of line (with /m flag) or string
  • (.+?) — non-greedy capture (matches as little as possible)
  • (?i) — turn on case-insensitive in the middle of the pattern
  • [^,]+ — one or more characters that are NOT comma (great for CSV parsing)
  • (foo|bar|baz) — match any of these alternatives

Multi-rule pipelines: the killer feature

Real text cleanup almost never fits in one rule. Cleaning markdown that came out of a copy-paste from Notion typically needs: (1) strip image tags, (2) convert **bold** to <strong>, (3) convert *italic* to <em>, (4) collapse multiple blank lines, (5) trim each line. Five rules. Save the set as "Notion → HTML" and you have a reusable pipeline that converts a Notion paste in one click — no more retyping the same regex chain every time. Power users build dozens of saved sets for recurring chores: log file parsing, JSON-to-CSV reformatting, removing tracking parameters from URLs, normalising hashtags.

Frequently Asked Questions

Why use this instead of my browser's built-in Ctrl+F find-and-replace?

Three reasons. First, multi-rule pipelines: you can run 5-10 transformations in sequence and save them as a named workflow. Second, regex with capture groups: replace not just text but structures (wrap matches in HTML tags, swap two parts of a pattern, reformat dates). Third, instant preview with match counts and inline error reporting — a regex typo gets a clear error rather than silently failing.

How do regex capture groups work in the replacement field?

Wrap part of your pattern in parentheses to capture it, then reference it in the replacement with $1, $2, etc. Example: find <code>(\\w+)@(\\w+)</code>, replace with <code>$2 — $1</code>. The match "alice@example" becomes "example — alice". You can use up to nine numbered groups ($1–$9).

amp; refers to the entire match, useful for wrapping (find <code>https?://\\S+</code>, replace <code>[
amp;](
amp;)</code> turns plain URLs into Markdown links).

What regex flavour does this support?

Standard JavaScript RegExp. The same engine your browser uses for <code>String.replace</code>. Supported flags: g (global, on by default), i (case-insensitive), m (multiline — ^ and $ match line breaks), s (dotall — . matches newlines), u (unicode), y (sticky). Lookahead, lookbehind, named groups, and Unicode property escapes (<code>\\p{L}</code>) all work in modern browsers.

Why does my rule order matter?

Each rule runs against the output of the previous one. If rule 1 strips HTML tags and rule 2 looks for "<p>", rule 2 will find nothing because rule 1 already removed it. Reorder so rule 2 runs first if that's the intended behaviour. The drag-or-arrow reorder controls let you fix order without retyping the rules.

Are my rule sets stored online?

No — they are saved in your browser's localStorage. They persist across page reloads and browser restarts on the same device but never leave your machine. To move rule sets between devices, use Export to download a JSON file and Import on the other device.

Related Tools

  • ☰ Sort & Remove Duplicate Lines — Sort, deduplicate, shuffle, and filter lines of text. Free online line manipulation tool with regex filter, cu
  • 🧹 Whitespace & Text Cleaner — Strip extra spaces, tabs, blank lines, invisible Unicode characters, smart quotes, and other text gunk introdu
  • 🔗 URL Slug Generator — Generate clean, SEO-friendly URL slugs from any title. Free slug generator with transliteration, stop-word str
  • 💘 Secret Crush Detector — Party game: everyone secretly picks a crush with a PIN-protected pick, then reveal mutual matches. 100% privat
  • 🎲 Truth or Dare Generator (Smart Mode) — The smartest Truth or Dare generator online. 200+ prompts across 5 group types (friends/couples/office/family/
  • 📝 Word Counter — Count words, characters, sentences, and paragraphs instantly as you type. Free online word counter with readin
  • 🤖 ChatGPT Humanizer — De-robotize AI text in your browser. 200+ AI-tell swaps, contraction injection, em-dash cleanup, sentence-vari
  • Aa Case Converter — Convert text between UPPERCASE, lowercase, Title Case, camelCase, snake_case, kebab-case, and more.

Related: find and replace, find replace online, regex find and replace, bulk find and replace, multi rule find replace, text replace tool, regex tester, sed online, replace text online, find replace regex, capture group replace, markdown to html, strip html tags, collapse whitespace, free find replace tool, multiline regex replace, javascript regex tool