Frequently Asked Questions
Can I use capture groups in replacement?
Yes. Use references like $1, $2, etc., in the replacement field.
Which flags are supported?
Standard JavaScript flags such as g, i, m, s, u, and y are supported.
Is input text uploaded?
No. Replacement preview runs locally in your browser.
Example input/output
Input: Pattern: \bfoo\b / Replacement: bar / Input: foo is not foobar
Output: bar is not foobar
How it works
This tool constructs a JavaScript RegExp from your pattern and flags, then calls String.replace() with your replacement string. The result is shown instantly. Named capture groups like $<name> and backreferences like $1 are supported. Processing runs in your browser.
Common use cases
- Preview the result of a regex substitution before applying it to source code
- Test find-and-replace patterns on sample input
- Validate capture group substitutions in replacement strings