> For the complete documentation index, see [llms.txt](https://limechatai.gitbook.io/limechat-product-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://limechatai.gitbook.io/limechat-product-guide/client-shareable-docs/regex-add-update.md).

# Regex Add/Update

To ensure users provide valid Order IDs or mobile numbers, we use **regex-based validations**. Below is a step-by-step guide on how to check and modify the regex patterns currently in use:

***

### Steps to Check and Modify the Regex:

1. **Access Entity Management:**
   * Visit [Entity Management](https://limechat.retool.com/apps/5d41b054-e263-11ec-bfa7-53452463a643/Entity%20Management\(Internal\)).
2. **Select the Relevant Company:**
   * Navigate to the **"Company Centric"** tab.
   * Select the appropriate **Company** and allow the data to load.
3. **View Current Regex:**
   * Under **entities\_custom**, click on **"root"** to expand the entity details.
   * Locate the fields where regex patterns for **Order ID** and **Mobile Number** are configured.
4. **Modify the Regex if Required:**
   * Click on **"Modify Slot"** to update the regex pattern.
   * You can generate new regex using tools like **ChatGPT** based on sample orders or numbers.
   * Validate any new regex patterns using [Regex101](https://regex101.com/) to ensure correctness.

***

### Dual Validation Setup: Order ID or Mobile Number

* The system is configured to **accept and validate input using two types of regex**:
  * **Order ID Regex**: To detect valid order ID formats (e.g., purely numeric, alphanumeric with prefixes like "ORD12345", etc.).
  * **Mobile Number Regex**: To validate standard 10-digit mobile numbers.
* If a user enters either a valid order ID **or** a valid mobile number, the system will proceed accordingly based on the matched regex.

**Important:** Both regex patterns must be kept updated to avoid blocking valid user inputs during support interactions.

***

### Example for Reference:

| Example Type | Input Example          | Notes                                        |
| ------------ | ---------------------- | -------------------------------------------- |
| Order ID     | 45678, ORD12345, A7890 | Should match numeric or alphanumeric formats |
| Mobile No.   | 9876543210             | Should validate 10-digit mobile numbers      |

**Explanation:**

* Order IDs can vary between numeric, alphanumeric, or prefixed formats depending on the brand.
* Mobile numbers are typically expected to be a 10-digit sequence without any country code prefix unless specified.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://limechatai.gitbook.io/limechat-product-guide/client-shareable-docs/regex-add-update.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
