ComfyUI Node: Search In Text

Class Name

DF_Search_In_Text

Category
Derfuu_Nodes/Functions/String Operations
Author
Derfuu (Account age: 1829days)
Extension
Derfuu_ComfyUI_ModdedNodes
Latest Updated
2024-06-22
Github Stars
0.33K

How to Install Derfuu_ComfyUI_ModdedNodes

Install this extension via the ComfyUI Manager by searching for Derfuu_ComfyUI_ModdedNodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Derfuu_ComfyUI_ModdedNodes 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
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Search In Text Description

Search for patterns in text, aiding text analysis with flexible matching options and case sensitivity consideration.

Search In Text:

The DF_Search_In_Text node is designed to help you search for specific patterns within a given text. This node is particularly useful for tasks that require text analysis, such as finding keywords, validating text formats, or extracting specific information from a body of text. By leveraging either strict matching or regular expressions, this node provides flexibility in how patterns are identified. The node can also be configured to consider case sensitivity, making it adaptable to various text processing needs. Its primary goal is to streamline the process of text searching, making it efficient and straightforward for AI artists who may not have a deep technical background.

Search In Text Input Parameters:

Text

This parameter represents the body of text in which you want to search for a specific pattern. It is a string input where you can paste or type the text to be analyzed. The accuracy of the search results depends on the content of this text.

Pattern

The pattern parameter is the string or regular expression you want to search for within the provided text. This can be a simple word, a phrase, or a more complex regular expression, depending on the mode selected. The pattern is crucial as it defines what you are looking for in the text.

ConsiderRegister

This boolean parameter determines whether the search should be case-sensitive. If set to True, the search will consider the case of the characters in both the text and the pattern. If set to False, the search will be case-insensitive, treating uppercase and lowercase characters as equivalent. The default value is False.

Mode

The mode parameter allows you to choose between two search methods: "Strict" and "RegEx". The "Strict" mode searches for exact matches of the pattern within the text, while the "RegEx" mode uses regular expressions to find more complex patterns. This parameter provides flexibility in how the search is conducted, depending on your specific needs.

Search In Text Output Parameters:

BOOLEAN

This output parameter indicates whether the pattern was found in the text. It returns True if the pattern is found at least once and False if the pattern is not found. This boolean value helps you quickly determine the presence of the pattern in the text.

OCCURRENCES

This output parameter provides the number of times the pattern was found in the text. It returns an integer value representing the count of occurrences. This information is useful for understanding the frequency of the pattern within the text.

Search In Text Usage Tips:

  • Use the "Strict" mode for simple, exact matches when you need to find specific words or phrases.
  • Utilize the "RegEx" mode for more complex searches, such as finding patterns that match a specific format or structure.
  • Set ConsiderRegister to True if the case of the text is important for your search, such as distinguishing between "Apple" and "apple".
  • Combine this node with other text processing nodes to create more advanced text analysis workflows.

Search In Text Common Errors and Solutions:

Pattern not found

  • Explanation: The specified pattern does not exist in the provided text.
  • Solution: Double-check the pattern for any typos or errors. Ensure that the ConsiderRegister setting is correctly configured for your needs.

Invalid regular expression

  • Explanation: The pattern provided is not a valid regular expression.
  • Solution: Review the pattern to ensure it follows the correct syntax for regular expressions. Use online tools to test and validate your regular expression before using it in the node.

Text input is empty

  • Explanation: The text parameter is empty, so there is no content to search within.
  • Solution: Provide a valid text input to search for the pattern. Ensure that the text field is not left blank.

Search In Text Related Nodes

Go back to the extension to check out more related nodes.
Derfuu_ComfyUI_ModdedNodes
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.