About this tool
Swap a name in a long text, remove line breaks from text copied out of a PDF, change date formats or replace several terms at once: with this tool you create as many find-and-replace rules as you like, applied to your text one after another. You see the result immediately, with the number of matches per rule.
Each rule searches for plain text or a regular expression, can match case and can find whole words only – including umlauts and accents. In regex mode the replacement can use groups ($1, $<name>) and \n for line breaks. Test patterns in depth with the Regex Tester; change case or sort lines with the Word & Character Counter.
The text is processed only in your browser and not uploaded. Regular expressions run in a background thread so an unlucky pattern cannot freeze the page.
How it works
- Paste your text at the top.
- In the first rule, enter what to find and what to replace it with. The toggles switch regex, case matching and whole words.
- Add more rules or quick rules if needed, e.g. “Line breaks → space”. Change the order with the arrow.
- Copy the result, or use it as the new input to apply further rules.
Frequently asked questions
Is my text stored anywhere?
No. Everything runs in your browser; the text is not transmitted. Text and rules are kept only in the part of the address after the #, so you can bookmark the state – that part is never sent to a server. Very long texts are not stored there.
In which order are the rules applied?
From top to bottom. Each rule works on the result of the one before. If the first rule replaces “a” with “b” and the second “b” with “c”, every “a” ends up as “c”.
How do I remove line breaks from copied text?
Click the quick rule “Line breaks → space”. It replaces every line break including surrounding spaces with a single space. To keep paragraphs, first replace double breaks (\n\n) with a placeholder character and restore them at the end.
What do ^ and $ mean in regex mode?
As in most editors, ^ and $ stand for the start and end of every line, not just of the whole text. So “^ +” removes the indentation of all lines, for example. The syntax is JavaScript’s.
Why was my search stopped?
Some patterns, such as nested repetitions like (a+)+, take extremely long on matching texts (“catastrophic backtracking”). After two seconds the tool stops instead of freezing the page. Simplify the pattern in that case.