Find and Replace Text Online (with Regex)
Replace text in bulk, with whole-word and regex support.
Use via API
Find and replace in text, as plain text or a JavaScript regular expression, with case sensitivity and whole-word options. Returns the result and match counts. Send JSON, get JSON back.
POST https://pithlab.com/api/v1/tools/find-and-replace
curl https://pithlab.com/api/v1/tools/find-and-replace \
-H "Authorization: Bearer $PITHLAB_KEY" \
-H "Content-Type: application/json" \
-d '{"input":"Colour, colour and more COLOUR.","find":"colour","replace":"color"}'About the Find and Replace
Find and replace words or phrases in any text, with case-sensitive, whole-word and regular-expression options. Shows how many matches were replaced.
How to use the Find and Replace
- Paste your text into the input box.
- Enter the text to find and what to replace it with. Leave the replacement empty to delete matches.
- Choose options: case-sensitive, whole words only, regular expression, and whether to replace all matches or just the first.
- Check the match count, then copy the result or download it.
Examples
Input
Find: cat · Replace: dog · Text: The cat sat. Cats like the cat flap.
Output
The dog sat. Cats like the dog flap.
Input
Find: (\d{2})/(\d{2})/(\d{4}) · Replace: $3-$2-$1 · Text: Due 31/12/2026Output
Due 2026-12-31
Frequently asked questions
What does whole word mean?
With Whole words only, a match must not be directly preceded or followed by a letter, digit or underscore. Searching for cat then matches "cat" and "cat." but not "cats" or "concatenate". It works for accented and non-Latin letters too.
Which regular expression syntax is supported?
JavaScript regular expressions, including groups, lookarounds and Unicode property escapes such as \p{L}. In the replacement, $1 inserts a captured group, $<name> a named group, $& the whole match and $$ a literal dollar sign.
What happens if my regex is invalid?
The tool shows the error message from your browser's regex engine and leaves your text unchanged until the pattern is fixed.
Are dollar signs in the replacement treated specially in plain mode?
No. When Regular expression is off, the replacement text is inserted exactly as typed, so $1 stays as $1.