Visit ComfyUI Online for ready-to-use ComfyUI environment
Facilitates text pattern replacement for AI text manipulation tasks with strict or regex matching.
The DF_String_Replace node is designed to facilitate the replacement of specific patterns within a given text string. This node is particularly useful for AI artists who need to manipulate text data efficiently, whether for preprocessing text inputs or modifying outputs. By leveraging this node, you can replace occurrences of a specified pattern with a new string, either through strict matching or using regular expressions for more complex pattern matching. This functionality is essential for tasks that require text normalization, data cleaning, or dynamic text generation, ensuring that your text data is formatted and modified according to your specific needs.
This parameter represents the input text string in which you want to perform the replacement. It is the primary text data that will be processed by the node. The content of this parameter directly impacts the result, as it is the source text where patterns will be searched and replaced. There are no specific minimum or maximum values for this parameter, but it should be a valid string.
The pattern parameter specifies the substring or regular expression pattern that you want to find within the input text. This pattern will be replaced by the string provided in the Replace_With parameter. The pattern can be a simple string for strict matching or a more complex regular expression if the Mode is set to RegEx. This parameter must be a valid string and can include special characters if using regular expressions.
This parameter defines the string that will replace the occurrences of the specified pattern in the input text. It is the new content that will be inserted in place of the matched patterns. The Replace_With parameter should be a valid string and can be any text that you want to use as a replacement.
The Mode parameter determines the method used for pattern matching. It can be set to either "Strict" or "RegEx". When set to "Strict", the node performs a straightforward string replacement, matching the pattern exactly as it appears. When set to "RegEx", the node uses regular expressions to find and replace patterns, allowing for more complex and flexible text manipulations. The available options for this parameter are "Strict" and "RegEx".
The TEXT output parameter contains the resulting string after the specified pattern has been replaced with the new string. This output reflects the modifications made to the input text based on the provided pattern, replacement string, and mode. It is a single string that shows the final result of the replacement operation, which can be used for further processing or as a final output.
© Copyright 2024 RunComfy. All Rights Reserved.