AContainsB(String)
It's a regex match, not a plain substring check
- BOOLEAN
The display name you'll see in ComfyUI's node picker is AContainsB(String), which reads like a plain "does string A show up inside string B" check. Look at the actual input field names, though, and the real behavior is more specific than the friendly name suggests: the first field isn't called input1 like everywhere else in this pack - it's called regex.
What it does
Two required STRING inputs. The first is literally named regex (default: empty string), and the second is input2 (also default empty). Given the field name, this isn't a plain substring search - it's a regex search or match of the pattern in regex against the text in input2. The output is a BOOLEAN.
That distinction matters the moment your search text contains any character that means something special in regex syntax: a period (.), parentheses, a plus sign, a dollar sign, square brackets, a backslash - all common in version strings, filenames, and file paths. Typed literally into the regex field, a period matches any character, not just a literal period; parentheses start a capture group; a + means "one or more of the previous thing." If you're checking for a literal string that happens to contain any of those characters, you need to escape them (a backslash before each special character) or the match won't behave like a simple "contains" check - it'll either fail to match text it should, or match text it shouldn't.
If genuinely all you want is "does string A appear literally inside string B" with zero regex behavior, this node can still do that for the common case - plain alphanumeric text with no special characters needs no escaping and behaves exactly like a substring check - but the moment your pattern has punctuation in it, treat this as regex, not as contains().
The inputs and outputs that matter
regex(required STRING, default"") - the pattern to search for. Plain text works like a substring match; anything with regex metacharacters gets interpreted as regex syntax.input2(required STRING, default"") - the text to search within.- Output:
BOOLEAN- whether the pattern matches.
Installing it
ComfyUI Manager: search ComfyUI-LogicUtils (the pack title - this node's display name won't turn up a useful Manager search on its own), install, restart. By hand: cd ComfyUI/custom_nodes && git clone https://github.com/aria1th/ComfyUI-LogicUtils, then restart. No models, no meaningful dependency chain - this is the same pack a Reddit thread specifically flagged as dependency-free when comparing lightweight logic-node options. There's an opt-in install hook (COMFYUI_LOGICUTILS_AUTO_INSTALL=1) with a hard off switch (COMFYUI_LOGICUTILS_SKIP_INSTALL=1); nothing heavy here means you'll likely never need either.
Where people get burned
The regex trap above is the whole story for this node, but it's worth restating concretely: if you're checking whether a filename contains something like v1.2 and you type that literally into the regex field, the period matches any character - so it'll also match v1x2, v1 2, anything with one character where the period sits. It'll usually still match what you actually meant, which is exactly the kind of thing that hides a bug until the one time it doesn't. If precision matters, escape the special characters (v1\.2) or keep the search text to plain alphanumerics where there's nothing to escape.
Beyond that, an invalid regex pattern (unbalanced parentheses, a dangling special character) will error at run time rather than fail gracefully - Python's regex engine raises on malformed patterns, and this node doesn't appear to catch that for you. As with the rest of this pack, the README's own admission that documentation hasn't caught up with the node count means the field names in the schema are, in practice, the most reliable spec you have.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| regex | STRING | — | |
| input2 | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BOOLEAN | BOOLEAN | — |