chiefletterAll tools

Coding / Chiefletter Workbench

Regex find and replace

Preview text replacements with a JavaScript regular expression.

Apply a JavaScript regular expression to a text sample and inspect the replacement before copying it. The tool supports global and case-insensitive flags and reports invalid patterns as input errors.

Use it here

Regex find and replace

Runs in your browser. Your input is not sent to Chiefletter.

How to use this tool

  1. Enter a pattern without slash delimiters.
  2. Set the replacement text and flags. Use $& to insert a full match or $1 for a capture group.
  3. Paste sample text, run the replacement, and inspect every changed line.

Use cases

  • Rename a repeated token in a document.
  • Test a cleanup pattern before using it in an editor.
  • Check capture groups on representative examples.

Notes and limits

Regular expressions may behave differently across languages. Test empty values, punctuation, Unicode, and long input. Avoid running an untrusted pattern on very large text.

Frequently asked questions

Does the tool change my original text?

No. The result appears separately. Your input remains in the text area.

What does the global option do?

It replaces every match. Without global mode, JavaScript replaces only the first match.

Does this support PCRE syntax?

No. The pattern uses the browser’s JavaScript regular expression engine.