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

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

Parameters: Regex Expression for Arc XP Sales APIs

Error codes resulting from POST, PATCH, or PUT requests are often due to invalid information being sent to the Arc XP Sales system.

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                |
| -------------------------------------- | --------------------------------------------------------------- | ------------------- |
| Address (line1)                        | \[a-zA-Z-\_0-9\]+                                               | _min_: 1 _max_: 256 |
| Address (line2)                        | \[a-zA-Z-\_0-9\]+                                               | _min_: 1 _max_: 256 |
| Address (locality)                     | \[a-zA-Z-\_0-9\]+                                               | _min_: 1 _max_: 100 |
| Address (region)                       | \[a-zA-Z-\_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     |
| Reason (Cancel Subscription)           | ^\[\\p{L}'/ 0-9:\\\\,"\`\\n\\r?.!@#$%^\*()\\-\_=+\~;\]{0,2048}$ |                     |
| browserInfo (Finalize Payment Request) | (\[0-9a-zA-Z+/=:"\_{}\]+)                                       | _max_:1024 _max_:2  |
| Phone (Finalize Payment Update)        | (^\[0-9-\]\*$\|^NA$)                                            | _min_:0 _max_:12    |
| Token (Linked subscription)            | \[\\w\\-&.\]+                                                   | _min_: 1 _max_:2048 |
| name (Gift Subscription)               | ^\[\\p{L}'/ 0-9:\\\\,"\`\\n\\r?.!@#$%^\*()\\-\_=+\~;\]{1,100}$  | _min_: 1 _max_:100  |
| note (Gift Subscription)               | ^\[\\p{L}'/ 0-9:\\\\,"\`\\n\\r?.!@#$%^\*()\_=+\~;-\]{1,500}$    | _min_: 1 _max_:500  |
| ampReaderId                            | ^\[a-zA-Z0-9\_-\]{1,128}$                                       |                     |
| name (Enterprise Subscription)         | ^\[a-zA-Z0-9\_-\]{1,100}$                                       |                     |
