ComfyUI Node
Regex Extract
Extracts the first or all regex matches from text. If the pattern has a capture group, returns the group; otherwise the whole match.
Regex Extract
- match
- count
◄text—►
◄pattern—►
◄case_insensitivefalse►
◄multilinefalse►
◄dotallfalse►
◄all_matchesfalse►
◄default►
CategoryMoonPack/string
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | Source text. | |
| pattern | STRING | Regex pattern. Use a capture group to extract a substring. | |
| case_insensitiveopt | BOOLEAN | false | — |
| multilineopt | BOOLEAN | false | — |
| dotallopt | BOOLEAN | false | — |
| all_matchesopt | BOOLEAN | false | If true, every match is emitted as a separate item (OUTPUT_IS_LIST). |
| defaultopt | STRING | Returned when there is no match. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| match | STRING | — |
| count | INT | — |