ComfyUI > Nodes > ComfyUI-LogicUtils > AContainsB(String)

ComfyUI Node: AContainsB(String)

Class Name

LogicGateCompareString

Category
Logic Gates
Author
aria1th (Account age: 3016days)
Extension
ComfyUI-LogicUtils
Latest Updated
2026-01-21
Github Stars
0.1K

How to Install ComfyUI-LogicUtils

Install this extension via the ComfyUI Manager by searching for ComfyUI-LogicUtils
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-LogicUtils in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

AContainsB(String) Description

The node checks if a regex pattern exists in a string, returning a boolean for pattern matching.

AContainsB(String):

The LogicGateCompareString node is designed to determine if a specified pattern, defined by a regular expression (regex), is present within a given string. This node is particularly useful for tasks that require pattern matching or validation within text data, such as searching for specific keywords, validating formats, or extracting information based on patterns. By leveraging the power of regular expressions, this node provides a flexible and powerful way to perform complex string comparisons, making it an essential tool for AI artists who need to automate text analysis or processing tasks. The node returns a boolean value indicating whether the pattern was found, allowing for easy integration into larger logic workflows.

AContainsB(String) Input Parameters:

regex

The regex parameter is a string that defines the regular expression pattern to search for within the input string. Regular expressions are sequences of characters that define a search pattern, which can be used for string matching. This parameter allows you to specify complex search criteria, such as finding specific words, patterns, or character sequences. The default value is an empty string, which means no pattern is specified. There are no explicit minimum or maximum values, but the complexity of the regex can impact performance.

input2

The input2 parameter is the string in which the node will search for the pattern defined by the regex parameter. This is the text data that you want to analyze or validate against the specified pattern. The default value is an empty string, indicating that no text is provided initially. Like the regex parameter, there are no explicit minimum or maximum values, but the length and content of the string can affect the node's execution time and results.

AContainsB(String) Output Parameters:

BOOLEAN

The output of the LogicGateCompareString node is a boolean value. This output indicates whether the specified regex pattern was found within the input string. A value of True means that the pattern was successfully matched, while False indicates that the pattern was not found. This boolean output can be used to trigger further actions or decisions within a logic workflow, making it a versatile component for text-based automation tasks.

AContainsB(String) Usage Tips:

  • Use simple regex patterns for faster performance, especially when working with large strings. Complex patterns can slow down the execution.
  • Test your regex patterns separately to ensure they match the intended text before using them in the node, as incorrect patterns can lead to unexpected results.

AContainsB(String) Common Errors and Solutions:

Invalid regular expression

  • Explanation: This error occurs when the regex pattern provided is not valid, possibly due to syntax errors or unsupported expressions.
  • Solution: Review the regex pattern for syntax errors and ensure it adheres to the correct regular expression syntax. Use online regex testers to validate your pattern before using it in the node.

Empty input string

  • Explanation: If the input2 parameter is an empty string, the node will not find any matches, resulting in a False output.
  • Solution: Ensure that the input2 parameter contains the text data you want to analyze. Double-check that the input string is correctly passed to the node.

AContainsB(String) Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-LogicUtils
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

AContainsB(String)