Field validation: Regular Expressions : Stop Invalid Characters
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2022 09:09 AM
Hello All,
I have a requirement where I need to validate a field in service catalog. It shouldn't allow special characters as '`~!@#$%^&*()|+=?;:'",<>{} []\/
Also it shouldn't allow
\W = Anything that isn't a word character (including punctuation etc)
\s = Anything that is a space character (including space, tab characters etc)
also it shouldn't allow the domain @xx.com
I tried creating a new variable validation regex with regular expression as [a-zA-Z0-9]{1,20} and using it under Validation Regex.
With this it is not allowing any special characters as such, but how can I incorporate \W \s and domain @xx.com, in the same regular expression.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2022 09:12 AM
You can use below regex:
^([a-zA-Z0-9_\-\.]+)@domain\.com$
Follow below link:
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 02:38 PM
Hi
Is your query resolved?
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar