> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prompteus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# If Input Contains

> Learn how to use the **If Input Contains** node to create conditional logic based on input content patterns.

The **If Input Contains** node allows you to create dynamic paths in your workflow by checking if inputs contain specific text patterns or match regex expressions. The node evaluates conditions using OR logic, executing the path if any condition is met.

## Functionality

The **If Input Contains** node acts as a content filter, analyzing input text and directing the flow based on pattern matching. This can be useful for:

* Content Filtering: Route inputs containing specific keywords or patterns
* Safety Checks: Identify and handle inputs with particular content
* Dynamic Routing: Create different processing paths based on input content
* Pattern Recognition: Use regex to identify complex text patterns

## Node Properties

For each condition you add, you can configure:

* **Text to Match:** The pattern or text to search for in the input
* **Use Regex:** Toggle to enable regular expression pattern matching
* **Case Sensitive:** Toggle to make the pattern matching case sensitive

<Note>
  Multiple conditions are evaluated using OR logic — if any condition is true, the workflow will proceed down the true path. To use AND logic, simply chain multiple **If Input Contains** nodes together.
</Note>

## Usage Examples

### Scenario: Content-Based Routing

Let's say you want to handle inputs differently based on whether they contain questions about specific topics:

1. Add an **If Input Contains** node to your workflow
2. Add conditions for different keywords:
   * Text: "pricing" (for pricing-related queries)
   * Text: "support" (for support-related queries)
3. Connect the "True" path to specialized handling nodes
4. Connect the "False" path to general handling nodes

### Scenario: Pattern Matching with Regex

To identify inputs containing email addresses or specific formats:

1. Add an **If Input Contains** node
2. Enable "Use regex"
3. Add a condition with pattern: `[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}`
4. Route matching inputs to appropriate handling nodes

## Tips and Best Practices

* Start with simple text matches before using regex for complex patterns
* Use case sensitivity thoughtfully — consider your use case requirements
* Combine multiple conditions to create more sophisticated routing logic
* Test your conditions with various input texts to ensure proper routing
* Consider checking the Execution Logs to track which conditions are being triggered
