Regex

Regex Replace Tester

Preview JavaScript regex replacements locally, including replacement tokens and the number of replacements.

Keep this tool in your workbenchReport a problem

Loading JavaScript Regex controls…

What does this tool do?

Preview JavaScript regex replacements locally, including replacement tokens and the number of replacements. Code Station Regex tools use the JavaScript regular expression engine. Inputs: Regex Pattern, Test text, Flags, Replacement text. Outputs: Replaced text, Replacement count.

How to use it?

Enter a pattern, test text and replacement text. Select g to replace every match. Choose “Replace text”, then copy individual result values if needed. Clear removes all inputs and results and restores option defaults.