Skip to main content

Bulk Text Replacer

Apply up to ten find-and-replace rules in one pass, with optional regular expressions and case-insensitive matching, plus presets for common cleanups.

Define up to ten replacement rules and apply them all in a single pass, each independently set to plain text or regular expression matching and to respect or ignore case. Six presets cover the cleanups that come up most often.

Bulk Text Replacer
// REPLACEMENT RULES
#1
Find
→
Replace with
// PRESETS
The result appears here...

// Bulk Text Replacer: Features

Ten rules, applied in order

Rules run top to bottom, and each one operates on the output of the one before it. That ordering is a feature rather than an accident: you can strip markup with one rule, collapse the whitespace it left behind with the next, and then drop the blank lines that produced. It also means a rule can accidentally undo an earlier one, so when a result is not what you expected, check whether a later rule is matching text the earlier one introduced.

Plain text or regular expression, per rule

Each rule chooses independently. Plain text matching escapes everything you type, so a search for a dot finds a literal dot rather than any character, which is what you want most of the time. Regular expression matching unlocks patterns, capture groups and the escape sequences for newline and tab. Mixing the two across rules is common: a literal replacement for a known string alongside a pattern for a family of them.

The presets, and what they are for

Newlines to commas turns a column copied from a spreadsheet into a comma-separated list, and the reverse turns a list back into lines. Tabs to spaces normalises indentation pasted from somewhere else. Collapsing repeated spaces cleans up text that has been reflowed. Dropping blank lines tidies output that has been double-spaced. Stripping HTML tags reduces markup to its text. Each loads as an editable rule, so they are starting points rather than fixed operations.

Escapes in the replacement

In regular expression mode the replacement understands the escape sequences for newline and tab, which is what makes converting a comma-separated list back into lines possible at all. It also means a literal backslash in your replacement needs care. If a replacement is producing a stray letter n where you expected a line break, the rule is in plain text mode rather than regular expression mode.

Cleaning exported records and logs safely

All processing happens in your browser. Log excerpts, exported records, draft documents and content pulled from an internal system can all be cleaned here without being transmitted, stored or logged. The replacement count shows how many substitutions were made in total, which is the quickest check that a rule matched what you intended.

// Bulk Text Replacer: FAQ

How many rules can I apply?

Up to ten, applied in order from top to bottom. Each rule works on the result of the previous one, which lets you build a cleanup sequence rather than running several separate passes.

Does the order of rules matter?

Yes, and it is often the explanation when output looks wrong. A rule that removes markup changes what later rules see, and a later rule can match text an earlier one introduced. When debugging, disable rules from the bottom up until the output makes sense.

When should I use regular expression mode?

When you are matching a pattern rather than a fixed string: a family of tags, a date in any format, anything followed by anything. For a known literal, plain text mode is safer because it escapes special characters for you, so a search for a dot or a bracket does what it looks like it does.

How do I replace something with a newline?

Switch the rule to regular expression mode and use the escape sequence for a newline in the replacement field. In plain text mode the replacement is taken literally, so you would get the characters themselves rather than a line break.

What does the case-insensitive option do?

Makes that rule match regardless of letter case, so a search for a word finds it capitalised or not. It applies per rule, so you can have one case-sensitive rule and one insensitive rule in the same sequence.

Is stripping HTML tags safe for extracting text?

It works for straightforward markup and is convenient, but it is a pattern match rather than a parser. Content inside script or style elements is left behind as text, HTML entities are not decoded, and unusual markup can defeat the pattern. For anything you will publish, parse properly rather than stripping with a regular expression.

Why does my regular expression report an error?

Because it is not valid, and the message names the rule and the parser's complaint. Unbalanced brackets or parentheses are the usual cause, followed by an unescaped special character that you meant literally. Switching that rule to plain text mode is often the real fix.

Can I use capture groups in the replacement?

Yes, in regular expression mode, using the standard numbered references. This is how you reorder parts of a line, such as turning a name written surname first into given name first, in a single rule.

What does the replacement count tell me?

The total number of substitutions made across all rules. It is the fastest way to confirm a rule matched at all: a count of zero when you expected many usually means the pattern is wrong or the case does not match.

Is the text and are the rules sent to a server?

No. Every rule is applied in your browser, and neither the text nor the rules are transmitted, stored or logged.

// How to Use Bulk Text Replacer

  1. Paste the text to clean

    Put the text into the input box. Log output, an exported record set or a document pulled from elsewhere are the usual candidates.

  2. Build your rules

    Add up to ten rules, setting each to plain text or regular expression mode and choosing whether case matters. Load a preset first if one of the common cleanups is close to what you need, then edit it.

  3. Check the count, then copy

    The replacement count confirms the rules matched. A count of zero means a pattern is not matching; a count far higher than expected usually means a rule is broader than intended.

Category Text