Skip to content
PithLab

↑↓ to move · Enter to open · Esc to close

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"}'

Fields and responseOpenAPI documentGet an API key

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

  1. Paste your text into the input box.
  2. Enter the text to find and what to replace it with. Leave the replacement empty to delete matches.
  3. Choose options: case-sensitive, whole words only, regular expression, and whether to replace all matches or just the first.
  4. Check the match count, then copy the result or download it.

Examples

Replace a whole word everywhere

Input

Find: cat · Replace: dog · Text: The cat sat. Cats like the cat flap.

Output

The dog sat. Cats like the dog flap.
Reorder dates with a regular expression

Input

Find: (\d{2})/(\d{2})/(\d{4}) · Replace: $3-$2-$1 · Text: Due 31/12/2026

Output

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.