# Adding Regex to intent examples

**URL:** <https://forum.rasa.com/t/adding-regex-to-intent-examples/48990>\
**Category:** Rasa Open Source\
**Created:** [November 4, 2021, 3:23pm UTC](https://forum.rasa.com/t/adding-regex-to-intent-examples/48990 "2021-11-04T15:23:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![qamir](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/qamir/32/16798_2.png) [@qamir](https://forum.rasa.com/u/qamir)\
**Post date:** [November 4, 2021, 3:23pm UTC](https://forum.rasa.com/t/adding-regex-to-intent-examples/48990/1 "2021-11-04T15:23:55Z")

</div>

Hi,

I’m trying to the following Regex to the training examples for an intent: `[0-9]{4}`

but run get the following error after I run rasa train:

`InvalidEntityFormatException: Incorrect training data format ('{4}').`

Any idea why I get the error? I’ve included my config file below

Thanks Qamir

```auto
pipeline:

# # No configuration for the NLU pipeline was provided. The following default pipeline was used to train your model.

# # If you'd like to customize it, uncomment and adjust the pipeline.

# # See https://rasa.com/docs/rasa/tuning-your-model for more information.

- name: SpacyNLP

model: "en_core_web_md"

- name: SpacyTokenizer

- name: RegexFeaturizer

- name: RegexEntityExtractor

- name: CountVectorsFeaturizer

analyzer: char_wb

min_ngram: 1

max_ngram: 4

- name: SpacyFeaturizer

pooling: mean

- name: SpacyEntityExtractor

dimensions: ["PERSON", "ADDRESS"]

- name: DIETClassifier

epochs: 100

# Configuration for Rasa Core.

# https://rasa.com/docs/rasa/core/policies/

policies:

# # No configuration for policies was provided. The following default policies were used to train your model.

# # If you'd like to customize them, uncomment and adjust the policies.

# # See https://rasa.com/docs/rasa/policies for more information.

- name: MemoizationPolic

- name: RulePolicy

- name: TEDPolicy

max_history: 5

epochs: 100

constrain_similarities: true

```

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [November 4, 2021, 7:07pm UTC](https://forum.rasa.com/t/adding-regex-to-intent-examples/48990/2 "2021-11-04T19:07:41Z")

</div>

Can you try `\d{4}` instead?

Also please show us how you wrote the Regex rule in the NLU file if it doesn’t work.
