Regex Scripts
Automatic find-and-replace at four points in the pipeline.
Modes
A regex script runs at one of four points:
| Mode | Runs on |
|---|---|
editinput | Your message, before it enters the prompt. |
editoutput | The model's reply, before it is saved. |
editprocess | The whole prompt during assembly. |
editdisplay | The rendered message; storage stays untouched. |
Script fields
Each script is a pattern, a replacement (with $1-style capture references), and flags. Scripts attach to characters, so cards can ship their own text pipeline.
editdisplay is the safe playground: it only changes what you see, never what is stored or sent, so a broken pattern cannot corrupt a chat.
Meta directives
Directives inside the script body control execution: an order tag fixes the position in the pipeline when multiple scripts run in the same mode, and action directives move or transform the matched text instead of a plain replace.
<order 10>
@@move_topExample
Convert asterisk emphasis into markup in the display layer:
IN: \*(.+?)\*
OUT: <em>$1</em>SillyTavern regex scripts import as part of character cards and run under the same modes.