Nodes/comfyui-moonpack/Regex Extract
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.

By moonwhaler·Created about a year ago·Updated 25 days ago· 15
Regex Extract
    • match
    • count
    text
    pattern
    case_insensitivefalse
    multilinefalse
    dotallfalse
    all_matchesfalse
    default
    CategoryMoonPack/string

    Inputs (7)

    NameTypeDefaultDescription
    textSTRINGSource text.
    patternSTRINGRegex pattern. Use a capture group to extract a substring.
    case_insensitiveoptBOOLEANfalse
    multilineoptBOOLEANfalse
    dotalloptBOOLEANfalse
    all_matchesoptBOOLEANfalseIf true, every match is emitted as a separate item (OUTPUT_IS_LIST).
    defaultoptSTRINGReturned when there is no match.

    Outputs (2)

    NameTypeDescription
    matchSTRING
    countINT