ComfyUI Node Runs on cloud
Text Extract
Pull every match of a regular expression out of a text, or the part one group captures, such as the number in `30 steps`. The matches come out as one LIST, as the first match and its count, and as a STRING list that runs the nodes below once per match.
Text Extract
- matches
- first
- count
- match
◄text—►
◄pattern►
◄group0►
◄ignore_casetrue►
CategoryWAS Suite/Text/Search
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | The text searched, as `Steps: 30, CFG scale: 7`. Wired from a STRING list, the node runs once per entry. | |
| pattern | STRING | A regular expression, as `(\d+) steps` or `Steps: (\d+)`. Empty finds nothing. A search past 1 second stops with an error. | |
| group | INT | 00–99 | 0 = the whole match; 1 = the first parenthesised group, so `(\d+) steps` gives `30`; 2 = the second. A group the pattern lacks stops the run. |
| ignore_case | BOOLEAN | true | On = `steps` matches `Steps`; off = case must match. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| matches | ARRAY | Every match in order, on one wire for Text List Get, Text List Filter and the other list nodes. Empty when nothing matched. |
| first | STRING | The first match, or an empty string when nothing matched. |
| count | INT | How many matches were found. 0 = none. |
| match | STRING | Every match as a STRING list, so a node reading it runs once per match. No match stops the nodes reading it. |