# Parameters: Regex Expression and validation for Arc XP Identity APIs

Source: https://dev.arcxp.com/subscriptions/identity/learn/parameters-regex-expressions/

Parameters: Regex Expression for Arc XP Identity APIs

Error codes resulting from POST, PATCH, or PUT requests are often due to invalid information being sent to the Arc XP Identity system. Regex validations are applied when calling:

| Public APIs                                                               | Developer APIs                                                                                  |
| ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| POST /identity/public/v1/signup  PUT \| PATCH /identity/public/v1/profile | POST /identity/api/v1/signup  PUT /identity/api/v1/profile/:uuid  POST /identity/api/v1/migrate |

In the tables provided below, you could find some regex expression used to validate some of these values.

You can use a regex tester (for example, <https://regex101.com/>) to know if the value you are trying to send is valid.

| Parameter          | Regex exp \| Format                              | Size                |
| ------------------ | ------------------------------------------------ | ------------------- |
| first name         | ^\[\\p{L}''.\]\[ \\p{L}.''-\]\[\\p{L}'\]$        | _min_: 1 _max_: 100 |
| last name          | ^\[\\p{L}''.\]\[ \\p{L}.''-\]\[\\p{L}'\]$        | _min_: 1 _max_: 100 |
| second last name   | ^\[\\p{L}''.\]\[ \\p{L}.''-\]\[\\p{L}'\]$        | _min_: 1 _max_: 50  |
| display name       | ^\[\\p{L}'0-9\]\[ \\p{L}'-\_0-9\]\[\\p{L}0-9\]$  | _min_: 1 _max_: 100 |
| birth year         | ^\[1-9\]\[0-9\]{3}                               | yyyy                |
| birth month        | ^\[0\]\[1-9\]\|^\[1-9\]\[0-2\]?                  | mm                  |
| birth day          | ^\[0\]\[1-9\]\|^(\[1-9\]|\[12\]\[0-9\]|3\[01\])$ | dd                  |
| contacts (phone)   | \[0-9-\]+                                        | _max_: 19           |
| Address (line1)    | ^\[\\p{L}0-9# \_.!@\*(),;/-\]+$                  | _min_: 1 _max_: 256 |
| Address (line2)    | ^\[\\p{L}0-9# \_.!@\*(),;/-\]+$                  | _min_: 1 _max_: 256 |
| Address (locality) | ^\[\\p{L}0-9 -')(\]+$                            | _min_: 1 _max_: 100 |
| Address (region)   | ^\[\\p{L}0-9 -')(\]+$                            | _min_: 1 _max_: 100 |
| Address (postal)   | ^\[\\p{L}0-9\_ -\]+$                             | _min_: 1 _max_: 100 |
| Address (country)  | ^\[A-Z\]{2}                                      | _min_: 2 _max_:2    |
| Attibute (name)    | _NA_                                             | _min_: 1 _max_:30   |
| Attibute (value)   | _NA_                                             | _min_: 1 _max_:1000 |
