Skip to main content

Find your next tool

Prepare, check, then export

Find and Replace Text Online (Regex, Bulk Rules)

Paste your text, type what to find and what to put in its place, and the result updates as you type with the number of replacements. Add more rules to make several changes in one pass, tick Pattern (regex) for regular expressions, or start from a preset such as Line breaks → commas.

Loading text workspace…

Benefits

  • Runs up to 20 rules in order, each on the result of the one before, and shows how many times each rule matched.
  • Whole words only works in every script: cat does not match inside concat or catégorie, and a Hindi word does not match inside a longer one.
  • A pattern that runs too long is stopped after 4 seconds instead of freezing the page, so you can fix it and try again.

When this helps

  • Turn a column of names or IDs into a comma-separated list, or split a list at its commas into lines.
  • Rename a term across a long document, a subtitle file or a CSV export before you paste it back.
  • Reformat dates, strip HTML tags or quote each line for an SQL IN list with a regular expression.

How to use this tool

  1. Paste the text or import a TXT file.
  2. Type the text to find and its replacement. Leave Replace with empty to delete every match.
  3. Tick Pattern (regex) for a regular expression, add more rules or choose a preset, and set Match case or Whole words only if you need them.
  4. Check the counts and Changed lines, then copy, download or continue with the result.

How the rules match, and the details that trip people up

Each rule replaces every match at once, like Replace All in a word processor, and the rules run from top to bottom. Order matters: with cat → dog followed by dog → bird, every cat ends up as bird. Matching ignores upper and lower case unless Match case is ticked, using Unicode case folding, so Ä matches ä and Σ matches σ. A plain rule matches the text exactly as typed: a dot is a dot, and $ in the replacement is a dollar sign.

Line breaks are the change people ask for most. With the line-break option on (the default), \n in Find or Replace with means a line break and \t a tab, so the preset Line breaks → commas is simply \n replaced by a comma and a space. Turn the option off when you search for a real backslash, for example in a Windows path such as C:\new. Windows line endings (CR LF) are read as plain line breaks, so one rule covers files from any system.

Pattern (regex) uses JavaScript regular expressions with Unicode support, and ^ and $ match at the start and end of every line. In the replacement, $1 to $99 insert numbered groups, $<name> a named group, $& the whole match and $$ a dollar sign. The pattern (\d{4})-(\d{2})-(\d{2}) with $3/$2/$1 turns 2026-11-12 into 12/11/2026, and ^(.+)$ with '$1', wraps each line in quotes. Some patterns, such as (a+)+ on a long run of letters, can take minutes to fail, so patterns run in a background thread and are stopped after 4 seconds with a message.

Whole words only checks that a match does not touch a letter, accent mark, digit or underscore on either side, in any script. The common \b shortcut knows only the English letters A to Z, which is why it splits catégorie or a Hindi word in tools that rely on it. In our test run, replacing colour with color in 1,054,000 characters (51,000 matches) took 7 ms, and three rules, including a pattern and a line-break join, took 22 ms. Changed lines lists up to 100 edited lines with their text before and after, whenever the rules keep the number of lines.

Formats, limits and privacy

  • Up to 2,000,000 characters in the editor, TXT files up to 2 MiB and up to 20 rules.
  • Case folding is the simple Unicode kind: ß does not match SS, and the Turkish dotted İ is not treated as I. Tick Match case and add each spelling as its own rule when that matters.
  • Patterns follow JavaScript syntax; lookbehind, named groups and \p{L} work. A dot does not match a line break, so use [\s\S] to match across lines.
  • For Word, PDF or spreadsheet files, replace in the original program or copy the text out first: this page edits plain text, so formatting is not kept.

These tools process text locally. There is no draft autosave. Download important work before leaving; temporary file handoffs expire after 30 minutes.

Frequently asked questions

How do I replace line breaks with commas?

Choose the preset Line breaks → commas, or make a rule that finds \n and replaces it with a comma and a space. The opposite preset, Commas → line breaks, splits a comma-separated list into one item per line.

How do I delete every match?

Leave Replace with empty. Every match of that rule is removed, and its count shows how many were deleted.

Can I make several replacements at once?

Yes. Select Add rule for up to 20 rules. They run in order, each on the result of the rule before it, and each rule shows its own match count.

How do I use capture groups?

Tick Pattern (regex), put brackets around the parts you want to keep and refer to them as $1, $2 and so on in Replace with. For example, (\w+) (\w+) with $2 $1 swaps two words. A named group such as (?<year>\d{4}) is inserted with $<year>.

Why did my pattern stop with a time-out?

Some patterns, usually nested repeats such as (a+)+ or (.*)*, try an enormous number of combinations before they fail. The page stops a pattern after 4 seconds so the tab stays usable. Make the repeated part more specific, for example [^,]+ instead of .*.

Is my text uploaded?

No. All rules run in your browser, and the text is not sent to MAXScanner or stored. Analytics record only which preset or option was used, never the text or what you searched for.

Continue your document workflow

Use a Continue button inside the workspace to carry your text; these links open a fresh tool.