• UnoRouterUNOROUTER
Documentation
  • Chat Guide
Getting Started
  • Getting Started
Characters & World
  • Characters
  • Personas
  • Lorebooks
  • Cards
Prompting
  • Presets
  • Prompt Template
  • Group Chats
Scripting
  • Macros (CBS)
  • Regex Scripts
  • Triggers & Lua
Context & Media
  • Memory & Context
  • Images
  • Custom Providers
Your Data
  • Your Data
Navigate
  • Models
  • Rankings
  • Inspector
  • Pricing
  • Chat
  • Status

Search docs...

Start typing to search documentation

PlatformIntegrationsChat
Chat Guide

Regex Scripts

Automatic find-and-replace at four points in the pipeline.

A regex script runs at one of four points:

ModeRuns on
editinputYour message, before it enters the prompt.
editoutputThe model's reply, before it is saved.
editprocessThe whole prompt during assembly.
editdisplayThe 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 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.

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.

text
<order 10>
@@move_top

Convert 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.

Macros (CBS)Triggers & Lua

On this page

Modes
Script fields
Meta directives
Example