Chat Guide
Regex Scripts
Automatic find-and-replace at four points in the pipeline.
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. |
Each script is a pattern, a replacement (with $1-style capture references), and flags. Scripts attach to characters, so cards ship their own text pipeline.
editdisplay only changes what you see, never what is stored or sent, so a broken pattern cannot corrupt a chat.
Directives in the script body control execution. An order tag fixes pipeline position when scripts share a mode. Action directives move or transform the match instead of replacing it.
text
<order 10>
@@move_topConvert asterisk emphasis into markup in the display layer:
text
IN: \*(.+?)\*
OUT: <em>$1</em>SillyTavern regex scripts import as part of character cards and run under the same modes.