What it does
Replace matches using the selected engine’s own template syntax and compare the text before and after.
How to use it
- Write the regex that finds what to replace.
- Write the replacement in the engine’s template syntax, or switch to literal text.
- Compare the before and after text; chain further steps if needed.
Verified example
Example
Text "a b\tc"
[ \t]+ Result: " ", "\t"
[ \t]+ Result: " ", "\t"
[ \t]+ Result: " ", "\t"
[ \t]+ Result: " ", "\t"
Counterexample
Text "abc"
[ \t]+ Result: no match
[ \t]+ Result: no match
[ \t]+ Result: no match
[ \t]+ Result: no match
Recorded by running fixture FX-R11 on : rp.js@1 on Node v24.21.0 (V8), v24.21.0, CPython 3.14.2 (Pyodide 314.0.7), PCRE2 10.48, go1.27.1. JavaScript results come from the rp.js@1 core on Node’s V8; your browser runs the same core.
Engines
- Template syntax differs: JavaScript and PCRE2 use $1, Python uses \1 or \g<1>, Go uses ${1}. The template is never rewritten between engines.
Limits
- The example below shows the matches a replacement acts on; the replaced text is computed by the tool when you run it.