Nodes/comfyui-moonpack/Regex String Replace
ComfyUI Node

Regex String Replace

Regex find/replace with case-insensitive, multiline, and dotall flags. Supports a non-destructive test_mode that highlights matches with >>>...<<<.

By moonwhaler·Created about a year ago·Updated 24 days ago· 15
Regex String Replace
    • text
    • match_count
    text
    pattern
    replacement
    case_insensitivefalse
    multilinefalse
    dotallfalse
    test_modefalse
    CategoryMoonPack/string

    Inputs (7)

    NameTypeDefaultDescription
    textSTRINGSource text.
    patternSTRINGPython regex pattern.
    replacementSTRINGReplacement string. Use \1, \2, … for capture groups.
    case_insensitiveoptBOOLEANfalseApply re.IGNORECASE.
    multilineoptBOOLEANfalseApply re.MULTILINE (^/$ match line boundaries).
    dotalloptBOOLEANfalseApply re.DOTALL (. matches newlines).
    test_modeoptBOOLEANfalseHighlight matches with >>>…<<< instead of replacing.

    Outputs (2)

    NameTypeDescription
    textSTRING
    match_countINT