ComfyUI Node
re.subn (Regex SubN)
re.subn(pattern, repl, string, count=0, flags=0) Perform the same operation as sub(), but return a tuple (new_string, number_of_subs_made). The replacement repl can be either a string or a callable; if a string, backslash escapes in it are processed.
re.subn (Regex SubN)
- 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 | — |