mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-15 02:47:16 +01:00
148 lines
7.7 KiB
HTML
148 lines
7.7 KiB
HTML
<div id="regex_editor_template">
|
|
<div class="regex_editor">
|
|
<h3 class="flex-container justifyCenter alignItemsBaseline">
|
|
<strong data-i18n="Regex Editor">Regex Editor</strong>
|
|
<a href="https://regexr.com/" class="notes-link" target="_blank">
|
|
<span class="note-link-span">?</span>
|
|
</a>
|
|
<div id="regex_test_mode_toggle" class="menu_button menu_button_icon">
|
|
<i class="fa-solid fa-bug fa-sm"></i>
|
|
<span class="menu_button_text" data-i18n="Test Mode">Test Mode</span>
|
|
</div>
|
|
</h3>
|
|
|
|
<small class="flex-container extensions_info">
|
|
Regex is a tool to find/replace strings using regular expressions. If you want to learn more, click on the ? next to the title.
|
|
</small>
|
|
<hr />
|
|
|
|
<div id="regex_test_mode" class="flex1 flex-container displayNone">
|
|
<div class="flex1">
|
|
<label class="title_restorable" for="regex_test_input">
|
|
<small data-i18n="Input">Input</small>
|
|
</label>
|
|
<textarea id="regex_test_input" class="text_pole textarea_compact" rows="4" placeholder="Type here..."></textarea>
|
|
</div>
|
|
<div class="flex1">
|
|
<label class="title_restorable" for="regex_test_output">
|
|
<small data-i18n="Output">Output</small>
|
|
</label>
|
|
<textarea id="regex_test_output" class="text_pole textarea_compact" rows="4" placeholder="Empty" readonly></textarea>
|
|
</div>
|
|
<hr>
|
|
</div>
|
|
|
|
<div class="flex-container flexFlowColumn">
|
|
<div class="flex1">
|
|
<label for="regex_script_name" class="title_restorable">
|
|
<small data-i18n="Script Name">Script Name</small>
|
|
</label>
|
|
<div>
|
|
<input class="regex_script_name text_pole textarea_compact" type="text" />
|
|
</div>
|
|
</div>
|
|
<div class="flex1">
|
|
<label for="find_regex" class="title_restorable">
|
|
<small data-i18n="Find Regex">Find Regex</small>
|
|
</label>
|
|
<div>
|
|
<input class="find_regex text_pole textarea_compact" type="text" />
|
|
</div>
|
|
</div>
|
|
<div class="flex1">
|
|
<label for="regex_replace_string" class="title_restorable">
|
|
<small data-i18n="Replace With">Replace With</small>
|
|
</label>
|
|
<div>
|
|
<textarea
|
|
class="regex_replace_string text_pole wide100p textarea_compact"
|
|
placeholder="Use {{match}} to include the matched text from the Find Regex or $1, $2, etc. for capture groups."
|
|
rows="2"
|
|
></textarea>
|
|
</div>
|
|
</div>
|
|
<div class="flex1">
|
|
<label for="regex_trim_strings" class="title_restorable">
|
|
<small data-i18n="Trim Out">Trim Out</small>
|
|
</label>
|
|
<div>
|
|
<textarea
|
|
class="regex_trim_strings text_pole wide100p textarea_compact"
|
|
placeholder="Globally trims any unwanted parts from a regex match before replacement. Separate each element by an enter."
|
|
rows="3"
|
|
></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex-container">
|
|
<div class="flex1 wi-enter-footer-text flex-container flexFlowColumn flexNoGap alignitemsstart">
|
|
<small>Affects</small>
|
|
<div>
|
|
<label class="checkbox flex-container">
|
|
<input type="checkbox" name="replace_position" value="1">
|
|
<span data-i18n="Before Char">User Input</span>
|
|
</label>
|
|
</div>
|
|
<div>
|
|
<label class="checkbox flex-container">
|
|
<input type="checkbox" name="replace_position" value="2">
|
|
<span data-i18n="After Char">AI Output</span>
|
|
</label>
|
|
</div>
|
|
<div>
|
|
<label class="checkbox flex-container">
|
|
<input type="checkbox" name="replace_position" value="3">
|
|
<span data-i18n="Slash Commands">Slash Commands</span>
|
|
</label>
|
|
</div>
|
|
<div class="flex-container wide100p marginTop5">
|
|
<div class="flex1 flex-container flexNoGap">
|
|
<small title="When applied to prompts or display, only affect messages that are at least N levels deep. 0 = last message, 1 = penultimate message, etc. Only counts usable messages, i.e. not hidden or system.">
|
|
<span data-i18n="Min Depth">Min Depth</span>
|
|
<span class="fa-solid fa-circle-question note-link-span"></span>
|
|
</small>
|
|
<input name="min_depth" class="text_pole textarea_compact" type="number" min="0" max="999" placeholder="Unlimited" />
|
|
</div>
|
|
<div class="flex1 flex-container flexNoGap">
|
|
<small title="When applied to prompts or display, only affect messages no more than N levels deep. 0 = last message, 1 = penultimate message, etc. Only counts usable messages, i.e. not hidden or system.">
|
|
<span data-i18n="Max Depth">Max Depth</span>
|
|
<span class="fa-solid fa-circle-question note-link-span"></span>
|
|
</small>
|
|
<input name="max_depth" class="text_pole textarea_compact" type="number" min="0" max="999" placeholder="Unlimited" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="flex1 wi-enter-footer-text flex-container flexFlowColumn flexNoGap alignitemsstart">
|
|
<small>Other Options</small>
|
|
<label class="checkbox flex-container">
|
|
<input type="checkbox" name="disabled" />
|
|
<span data-i18n="Disabled">Disabled</span>
|
|
</label>
|
|
<label class="checkbox flex-container">
|
|
<input type="checkbox" name="only_format_display" />
|
|
<span data-i18n="Only Format Display">Only Format Display</span>
|
|
</label>
|
|
<label class="checkbox flex-container" title="Chat history won't change, only the prompt as the request is sent (on generation)">
|
|
<input type="checkbox" name="only_format_prompt"/>
|
|
<span>
|
|
<span data-i18n="Only Format Prompt (?)">Only Format Prompt</span>
|
|
<span class="fa-solid fa-circle-question note-link-span"></span>
|
|
</span>
|
|
</label>
|
|
<label class="checkbox flex-container">
|
|
<input type="checkbox" name="run_on_edit" />
|
|
<span data-i18n="Run On Edit">Run On Edit</span>
|
|
</label>
|
|
<label class="checkbox flex-container" title="Substitute {{macros}} in Find Regex before running it">
|
|
<input type="checkbox" name="substitute_regex" />
|
|
<span>
|
|
<span data-i18n="Substitute Regex">Substitute Regex</span>
|
|
<span class="fa-solid fa-circle-question note-link-span"></span>
|
|
</span>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|