High-level: I am trying to collect a customer number that can be anywhere from 7-16 alpha-num characters long (for example; ADXG011008829, or PHBCG78233). Since no system entity types really fit this (other than sys.any) I have created a custom regex entity type using the pattern ^(?:[A-Za-z0-9]\s*){7,16}$ . According to any regex checker I can find, this should fit. When built however, I am getting validation errors stating that the annotated text in the training phrases does not match the entity type that I have created.
Can anyone spot if I’ve missed a step, or some important info somewhere?
Hi roundfarm,
Welcome to Google Cloud Community!
If your regex can match too many variations or partial matches, Dialogflow may reject it as overly broad. Your pattern ^(?:[A-Za-z0-9]\s*){7,16}$ might be interpreted as matching a wide range of inputs due to the optional whitespace (\s*) between characters. Try simplifying or tightening the pattern.
For additional guidance you may refer to this documentation. I also found this similar case that you may find useful.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.