ComfyUI Node
re.sub (Regex Sub)
re.sub(pattern, repl, string, count=0, flags=0) Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string[s] by the replacement repl. If the pattern isn't found, string is returned unchanged. count is the maximum number of pattern occurrences to be replaced.
re.sub (Regex Sub)
- flags
- result
- count
◄pattern►
◄string►
◄repl►
◄string_in—►
◄count0►
Categoryovum/regex
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| pattern | STRING | The regular expression pattern. | |
| string | STRING | The string to search. Used if `string_in` is not connected. | |
| repl | STRING | The replacement string or pattern. | |
| string_inopt | STRING | Input string or list of strings. Overrides `string` widget if connected. | |
| flagsopt | RE_FLAGS | 2 | Regex compilation flags. |
| countopt | INT | 0 | Maximum number of pattern occurrences to be replaced. 0 means replace all. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| result | STRING | — |
| count | INT | — |