re.fullmatch (Regex FullMatch)
The strictest regex check in the pack — validate whole strings, not fragments
- flags
- match
Sometimes you don't want "does this contain a match" - you want "is this entirely a match." That's re.fullmatch, and OvumReFullMatch is its ComfyUI port. It's the validation node of the regex family: the whole string must conform to the pattern, start to finish, or you get back None. Think hex color codes, UUIDs, filenames that must match a strict name_00001.png shape, seed strings that must be pure digits, URLs that must be well-formed. If it passes fullmatch, you can stop worrying about the format.
How it works
Feed it pattern and string, and it runs pat.fullmatch() over each input - no pos/endpos here, because a whole-string check doesn't need them. A match means the pattern consumed the entire string; a zero-length match doesn't count as success the way it can in match/search. The output is a RE_MATCH object per input (or None per miss), list-shaped so you can validate a batch of strings in one go via the optional string_in link, which overrides the widget and accepts a list.
Inputs you'll actually set:
pattern- the regex, in a multiline field.string- the text to validate.string_in- optional; overridesstringand handles lists element-wise.flags- RE_FLAGS from the re.compile flags node (default IGNORECASE on - for strict validation you may want that off, which is easy to forget).
The match output plugs into re.Match.group (to pull the whole validated value out via group 0), re.Match.span, or re.MatchView for a look at what passed. The status text says "Matched" or "No match" per run, or "Matched 2/5" for lists.
The workflow pattern
fullmatch shines as a gate. Wire it into a branch: if the match comes back non-None, the string is well-formed and you proceed; if None, it fails validation. It's the difference between a silent garbage filename flowing downstream and a clean stop. For example, checking a VHS-style output name against ^[A-Za-z]+_\d{5}\.(png|mp4)$ before a saver touches it, or confirming a hex color ^#[0-9a-fA-F]{6}$ before feeding it to a text overlay node.
Installing it
OvumReFullMatch ships in comfy-ovum. ComfyUI Manager → search "comfy-ovum", or:
cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum
Restart and it's under ovum/regex. No model files, no heavy dependencies; Manager installs the pack's small pure-Python requirements for you.
The trap
Because fullmatch is the strict sibling, people reach for it and then wonder why their "close enough" strings fail - a trailing newline or space makes the whole thing invalid. That's the point, but if you're validating user-ish text, trim first. And note it's genuinely different from re.match: fullmatch requires the pattern to consume everything; match only needs the start. Three matchers, three jobs: match (starts), search (somewhere), fullmatch (everywhere).
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| pattern | STRING | The regular expression pattern. | |
| string | STRING | The string to search. Used if `string_in` is not connected. | |
| string_inopt | STRING | Input string or list of strings. Overrides `string` widget if connected. | |
| flagsopt | RE_FLAGS | 2 | Regex compilation flags. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| match | RE_MATCH | — |