Define a regular expression for a variable
Share this page
Print
- UpdatedAug 1, 2024
- 1 minute read
- Xanadu
- Now Platform Capabilities
Define a regular expression (regex) to validate a variable value.
Before you begin
Role required: catalog_admin or admin
Procedure
- Navigate to All > Service Catalog > Catalog Variables > Variable Validation Regex.
- Click New.
-
On the form, fill the fields.
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\.\/#$\?=+@&%_:;]+)
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.
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.
- Click Submit.
Related Content
- Create a service catalog variable
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.