Nodes/comfy-ovum/_.re_findall
ComfyUI Node

_.re_findall

Pull Every Regex Match Out of a String

By sfinktah·Created about a year ago·Updated 10 months ago· 7
_.re_findall
  • obj
  • pattern
  • *
flagsfalse

_.re_findall is the "find every match, not just the first" regex node. Feed it a string and a pattern, and it returns a list of all the non-overlapping matches. Where most search nodes give you one hit, this one gives you the whole set - which is exactly what you want when you're parsing prompt tags, model names, or any repeated structure out of a text blob.

How it works

It's Python's re.findall, surfaced as a node. The two behaviors that matter:

  • No capture groups - you get a list of the matched substrings: pattern \d+ on "abc123def456"["123", "456"]
  • With capture groups - you get a list of the groups, as tuples when there's more than one: pattern (\d+)-(\d+)-(\d+) on a date → [("2026", "08", "16")]

Empty matches are included in the results, per the description, so a pattern that can match nothing will still turn up empty strings in the list.

Inputs:

  • obj - the string (or list of strings) to search
  • pattern - the regex pattern
  • flags - a BOOLEAN, which is the odd one out

Output: a LIST of matches.

The flags quirk

Regex flags in Python are integer bitmasks - re.IGNORECASE is 2, re.MULTILINE is 8 - so exposing a single boolean here is a bit of a blunt instrument. The practical reading: leave it off for the common case. If you need real flags - case-insensitive matching is the one people actually reach for - this pack ships a whole ovum/regex suite under its regex nodes with proper flag handling, and that's the better home for serious pattern work. _.re_findall is the quick-and-dirty version.

Where it fits

The realistic use is extracting a family of values from generated text: all the numeric steps out of a log line, all the tags out of a caption, all the frame numbers out of a string. The list it produces feeds straight into the family's list utilities or a loop. It also accepts a list of strings on the primary input and searches each one, appending the results - handy for scanning a batch of texts in one pass.

Installing

Part of comfy-ovum. ComfyUI Manager → search comfy-ovum → Install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum

Restart ComfyUI. No models, no extra pip packages for the underscore nodes - the port is bundled in the repo.

The bottom line

Every match, not just the first, with sensible group handling. Keep flags simple - the pack's dedicated regex suite exists for the fancy stuff.

Categoryovum/underscore

Inputs (3)

NameTypeDefaultDescription
objopt*Primary input object. Also accepts _.CHAIN to continue chaining.
patternopt*pattern: JSON allowed for arrays/objects where applicable.
flagsoptBOOLEANfalseflags (boolean)

Outputs (1)

NameTypeDescription
**