# pattern values

/\* Title: Entity Pattern Values Sort: 5 \*/ You can give an entity a number of values in order to recognise parts of a user utterance, and use them for validation when gathering information in Flow.

Pattern values are used when you want to allow a wider range of inputs, but still restrict them to a pattern. This is achieved using regular expressions (regex).\
So, you could assign the entity *@imageURL* a pattern named *JPG | GIF | PNG | SVG* that contained the following regex :

```codeblock
(http(s?):)([/|.|\w|\s|-])*\.(?:jpg|gif|png|svg)
```

This would reject any user input that didn’t conform to this regex pattern, i.e. a URL that ends with a specified file type.

***

In the following step-by-step example, we will :-

* [**Select an Entity**](https://humley.gitbook.io/humley-studio/enhance-assistant/entities/broken-reference)
* [**Add a Pattern Value**](https://humley.gitbook.io/humley-studio/enhance-assistant/entities/broken-reference)

### Select an Entity

From the Entity list page, select an entity and click **Create Value** (If the entity has no values yet, the sidebar will be automatically opened, showing the **Text Value** & [**Pattern Value**](https://humley.gitbook.io/humley-studio/enhance-assistant/entities/broken-reference) types to choose).

### Add a Pattern Value

Choose the **Pattern** value type from the sidebar

Enter in the sidebar -

* **Value Name** Name the value. All value names must be unique within the entity. This is just a label for the regex pattern(s) added to this value.
* **Pattern** (optional) Add a regex (regular expression) for this value. All Patterns must be unique within the Pattern Value. Any user inputs that conform to the regex pattern will be accepted and stored.

  Add multiple Patterns as required

Click **Create Value**

Your new pattern value will be shown in the value list under it's entity


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://humley.gitbook.io/humley-studio/enhance-assistant/entities/pattern-values.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
