Nodes/comfy-ovum/re.subn (Regex SubN)
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.

By sfinktah·Created 12 months ago·Updated 9 months ago· 6
re.subn (Regex SubN)
  • flags
  • result
  • count
pattern
string
repl
string_in
count0
Categoryovum/regex

Inputs (6)

NameTypeDefaultDescription
patternSTRINGThe regular expression pattern.
stringSTRINGThe string to search. Used if `string_in` is not connected.
replSTRINGThe replacement string or pattern.
string_inoptSTRINGInput string or list of strings. Overrides `string` widget if connected.
flagsoptRE_FLAGS2Regex compilation flags.
countoptINT0Maximum number of pattern occurrences to be replaced. 0 means replace all.

Outputs (2)

NameTypeDescription
resultSTRING
countINT