Issue symptoms
When I create an entity in an advanced AI agent, I can define rules with regular expressions (regex) to match different data sets.
For example, if I use a regular expression to match a mix of letters and numbers from 5 to 20 characters long, I might try this pattern:
(?=.*\d)[A-Za-z0-9-]{5,20}Although this regular expression is valid, it doesn't work when I test it in the AI agent.
The issue is the positive lookahead syntax. While regex101.com confirms that the expression matches the data set, positive lookahead may not be supported in AI agents – Advanced.
Resolution steps
Complete these steps:
- Don't use positive lookahead syntax in your regex
- Replace the regular expression with one that doesn't use positive lookahead, for example:
[A-Za-z-]*\d[A-Za-z0-9-]{4,19}For more information, see this article: Creating entities in conversation flows for advanced AI agents.