Edit

Share via


Regular expression entity

Important

Language Understanding Intelligent Service (LUIS) will be fully retired on March 31, 2026. LUIS resource creation isn't available. Beginning on October 31, 2025, the LUIS portal will no longer be available. We recommend migrating your LUIS applications to conversational language understanding to benefit from continued product support and multilingual capabilities.

A regular expression entity extracts an entity based on a regular expression pattern you provide.

A regular expression is best for raw utterance text. It ignores case and ignores cultural variant. Regular expression matching is applied after spell-check alterations at the token level. If the regular expression is too complex, such as using many brackets, you're not able to add the expression to the model. Uses part but not all of the .NET Regex library.

The entity is a good fit when:

  • The data are consistently formatted with any variation that is also consistent.
  • The regular expression does not need more than 2 levels of nesting.

Regular expression entity

Example JSON

When using kb[0-9]{6}, as the regular expression entity definition, the following JSON response is an example utterance with the returned regular expression entities for the query:

When was kb123456 published?:

"entities": [
  {
    "entity": "kb123456",
    "type": "KB number",
    "startIndex": 9,
    "endIndex": 16
  }
]

Next steps

Learn more about entities: