Can we define regex pattern in nlu.md?

I am trying to provide regex for my entities in nlu.md but they are working as expected. For example: I have defined an intent as follows:

intent:codes

  • code_123(code)
  • code_345(code)
  • code_567(code)

regex:code

  • \bcode_[1-9]{3}\b

It is accepting values beyond this regex pattern. Is there any alternative to do so?

Hi @ojas! Thanks for bringing this up :smiley: can you provide more details about the intents and examples you defined, maybe posting your nlu.md here?

I’m also not sure about your regex, maybe you can check the usage of \b again? If I’m not mistaken your current regex would also match something like foo code_123 and I’m not sure if you want to allow that.

Let me know if that helps!