This is a node to run regex for strings.
A ComfyUI custom node plugin that allows you to run regular expression operations directly in ComfyUI workflows.
This custom node is powered by ltdrdata and developed by Cursor
cd ComfyUI/custom_nodes/
git clone https://github.com/ltdrdata/ComfyUI-Regex-Runner
The plugin provides the following nodes:
text
: Input text to matchpattern
: Regular expression patternflags
: Regex flags (optional)text
: Input text to processpattern
: Regular expression patternreplacement
: Replacement textflags
: Regex flags (optional)Input text: "Image size is 512x512"
Pattern: "\d+"
Output: ["512", "512"]
Input text: "prompt: a cat"
Pattern: "^prompt: "
Replacement: "negative prompt: "
Output: "negative prompt: a cat"
Regex Not Matching?
How to Use Regex Flags?
re.IGNORECASE
, re.MULTILINE
, etc.MIT License
If you encounter any issues or have suggestions for improvements: