ComfyUI Node
Regex Node (Yogurt Nodes)
Regex-based extraction and replacement for multiline text.
Regex Node (Yogurt Nodes)
- text
◄text►
◄pattern►
◄modeextract►
◄format_or_replacement►
◄count0►
◄joiner►
CategoryYogurtNodes/String
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | The input text to process. Supports multiline content. | |
| pattern | STRING | The regular expression pattern. Supports Python regex syntax, including flags like (?s) for DOTALL. | |
| mode | COMBO | extract | The operation mode: 'extract' or 'replace'. extract keep the matched content as `format_or_replacement`, replace replace the matched content with `format_or_replacement`. |
| format_or_replacement | STRING | In 'extract' mode, this is the output format for each match (supports group refs like \g<1>). In 'replace' mode, this is the replacement string (supports group refs). | |
| count | INT | 0 | In 'extract' or 'replace' mode: If positive, operate on the first count matches; if negative, operate on the last abs(count) matches; if zero or abs(count) exceeds total matches, operate on all. |
| joiner | STRING | Only used in 'extract' mode. The string used to join multiple extracted results. Default is empty. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |