In this example we will configure Prime to validate that the purchase order number is a 6-8 character numeric value.
Below are a few examples of regular expressions. AI tools are often helpful for generating these. Simply provide examples of the different formats your purchase order numbers may follow, and the AI tool will create a regular expression that you can paste into Prime.\
\
**1. Starts with two letters followed by 6 digits (case-insensitive)**
`^[A-Za-z]{2}\d{6}$`
- `^[A-Za-z]{2}` → Two letters at the start.
- `\d{6}$` → Followed by exactly six digits.
- Case-insensitive can be enforced by adding the `i` flag in most regex engines (e.g., `/^[A-Za-z]{2}\d{6}$/i`).
**Example. PO123456,AB563651**
---
### ✅ **2. Value must be a number and between 7–10 digits**
`^\d{7,10}$`
- Matches only digits.
- Length between 7 and 10 characters.
---
### ✅ **3. Starts with 6 digits followed by 3 letters (case-insensitive)**
`^\d{6}[A-Za-z]{3}$`
- `^\d{6}` → Six digits at the start.
- `[A-Za-z]{3}$` → Followed by exactly three letters.
- Case-insensitive with `i` flag: `/^\d{6}[A-Za-z]{3}$/i`.