---
sourceDocument: Yokohama ServiceNow AI Platform Capabilities
sourceDocumentLink: https://www.servicenow.com/docs/r/yokohama/servicenow-platform

 Release :

    - yokohama

ft:locale :

    - en-US

ft:publication_title :

    - Yokohama ServiceNow AI Platform Capabilities

ft:clusterId :

    - platcap

bundleId :

    - platcap

workflow :

    - Platform


---

# Define a regular expression for a variable

# Define a regular expression for a variable {#ariaid-title1}

* Release version: Yokohama
* 
* Updated January 30, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

Define a regular expression (regex) to validate a variable value.

## Before you begin

Role required: catalog_admin or admin

## Procedure

1. Navigate to AllService CatalogCatalog VariablesVariable Validation Regex.
2. Click New.
3. On the form, fill the fields.  
   {#define-regex-vrble__table_b1s_q5g_xfb__entry__2}

   | Field | Description |
   |-|-|
   | Name | Name of the regular expression. |
   | Validation message | Message that appears when the validation fails. |
   | Active | Specifies if the regex is active. |
   | Regular Expression | Sequence of characters that define the format of the variable value. For example: * Invalid Regex: /(((ftp\|http\|https):\\/\\/)\|(www\\.))(\[-\\w\\.\\/#$\\?=+@\&%_:;\]+)/i * Valid Regex: (((ftp\|http\|https):\\/\\/)\|(www\\.))(\[-\\w\\.\\/#$\\?=+@\&%_:;\]+) {#define-regex-vrble__ul_ssb_2mn_3gb} Note: * Ensure that the regex does not cause catastrophic backtracking. * You should not use embedded flag expressions. * Use the Regex Flag list for the ignore case. {#define-regex-vrble__ul_hc2_pbg_3gb} |
   | Regex Flag | Character set that is considered while validating the regular expression. * None: No regex flags are applied. * Case Insensitive: Enables case insensitive matching. Case insensitive matching assumes that only characters in the US-ASCII charset are being matched. Unicode-aware case-insensitive matching can be enabled by selecting Both as the regex flag. * Unicode Case: (Reserved for future use) Same behavior as None. * Both: Case insensitive matching is done in a manner consistent with the Unicode Standard. {#define-regex-vrble__ul_jth_3xm_2gb} |
   [ ]

   {#define-regex-vrble__table_b1s_q5g_xfb}
4. Click Submit.
**Related tasks**   

* [Create a service catalog variable](https://www.servicenow.com/docs/d52no4a~93FsRHl87CSu~g "Create service catalogs variables to gather information from users ordering a catalog item, for example, to ask users which options they want for the item.")

*[\>]: and then


