-
-
Notifications
You must be signed in to change notification settings - Fork 220
Regex Script
Regex Script is a custom script that replaces string that matches by regex by IN to OUT.
There four type options.
-
Modify Input
: modifys user's input -
Modify Output
: modifys character's output -
Modify Request
: Data modifys current chat data when sent. -
Modify Display
: just modifies the text when shown without modifying chat data.
Regular Expressions, often shortened to Regex, can be described as a special kind of text pattern. Think of it like a sophisticated "Find" tool on steroids.
You know how you can use "Find" in a document to look for a specific word or phrase? RegEx lets you do that, but it's much more flexible. You can search for words that begin with a certain letter, end with a certain letter, are of a certain length, and much more.
For example, you might want to find all instances of phone numbers in a text, but phone numbers can be written in many different ways. Some people write '123-456-7890', others write '(123) 456-7890', and others might just write '1234567890'. A regular expression can be written in a way to find all these different formats at once.
The Finded strings are known as "Matches", which we use for Risu.
Regex on Risu is oftenly used for showing displays with HTML Syntaxes
For example, if you want to show complex GUI made by HTML with it. If you put HTML at the prompt and made AI to send the HTML again and again, It would take many tokens, and AI wouldn't Most likely won't work even.
Regex is used on this. If you use "Use Display" and set IN to something like \[status\]
and set OUT to the HTML, and make AI to send [status]
, ai would send [status] likly with less tokens, and make it show GUI with it.