Text Matching Expressions
A powerful tool for evaluating text conditions with Regex, Text, and Lambda evaluators.
Text Matching Expressions
Text matching expressions in EyeAuras are flexible tools for checking text-based conditions defined by the user. Three evaluator types are available: Regex, Text, and Lambda.
You may encounter them in Text Search, Network Message, Telegram Message, and some other trigger types.
Text evaluator
The Text evaluator compares input directly against the specified text. It is case-sensitive by default, but you can enable case-insensitive matching if needed.

Examples:
-
Match
Hello, world
Match text:Hello, world
This matches only the exact stringHello, world. -
Match a numeric string
Match text:12345
This matches the string12345. Note that it will not match the number12345entered without quotes. -
Case-insensitive match
Match text:HELLO
With case-insensitive mode enabled, this matcheshello,Hello,HELLO, and so on. -
Match a sentence
Match text:The quick brown fox jumps over the lazy dog
This matches the full sentence exactly as written.
Regex evaluator
The Regex evaluator lets you use regular expressions for more advanced and flexible text matching.

Examples:
-
Match any number
Regex:\d+
This matches any string representing a number, such as123,45678, and so on. -
Match any word
Regex:\b\w+\b
This matches any string representing a word, such asHello,World, and so on. -
Match any two letters
Regex:\b[a-zA-Z]{2}\b
This matches any string containing exactly two letters, such asab,cd, and so on. -
Match any three digits
Regex:\b\d{3}\b
This matches any string containing exactly three digits, such as123,456, and so on. -
Match any word that starts with a specific letter
Regex:\bH\w*\b
This matches any word that starts withH, such asHello,Hi, and so on. -
Match any word that ends with a specific letter
Regex:\b\w*e\b
This matches any word that ends withe, such ascode,node, and so on.
Lambda evaluator
The Lambda evaluator is a powerful tool that lets you write C# lambda expressions. It effectively converts a string into a boolean value based on the conditions you define, which gives you a very wide range of possibilities.
For example, you can create a lambda expression to check whether a string is empty, whether it contains specific characters, or whether it can be converted into a number within a certain range.

Examples:
-
Check whether a string is empty
Lambda expression:text => string.IsNullOrEmpty(text)
This returnsTruefor an empty string ornull, andFalseotherwise. -
Check whether a string contains
Hello
Lambda expression:text => text.Contains("Hello")
This returnsTrueif the string containsHello, andFalseotherwise. -
Check whether the string length is less than 5
Lambda expression:text => text.Length < 5
This returnsTrueif the string length is less than 5, andFalseotherwise. -
Check whether the string can be converted to a number within a specific range
Lambda expression:text => double.Parse(text) >= 1 && double.Parse(text) <= 100
This returnsTrueif the string can be converted to a number from 1 to 100, andFalseotherwise.
Testing mode
Testing mode is a useful feature that lets you enter a string value and verify that your expression works as expected, reducing the chance of errors. You can use it to fine-tune expressions for your needs.
Keep in mind that all evaluators work with strings and are compatible with any Unicode-supported language. There are no restrictions on the types of expressions you can create, and EyeAuras will warn you if an expression is invalid.