- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 01:26 PM
Hi Community,
I am currently using a regular expression of .{1,30} to limit the characters to 30 on a field. I want to add to it so no spaces (beginning, middle or end) are allowed and no special characters are allowed. Can anybody help with this? Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2023 06:34 AM
Hi @chrish5,
This should be better 🙂
^([A-z]|[0-9]){1,30}$
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2023 06:43 AM
Can you share the script you're using? The regex tested correct for me.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2023 06:52 AM
Here is what I have.
^([A-z]|[0-9]){1,30}$
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2023 07:05 AM
I'm afraid you are going to need to create a case with Now Support.
If you try it in the backend it works just fine. Only in the Service Portal the Regex is not validated correctly. So it seems to be an error in the widget, not in the regex.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2023 07:18 AM
Hi Peter,
Thanks for that information. I'll open a case with Now Support. Can you tell me how you are testing it on the backend to educate me and to also show Now Support how it is working properly but not on the Service Portal.
Thanks,
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2023 07:26 AM
Hi @chrish5,
I just pressed the try it button on the catalog item I configured it in. This opened the item in the backend.
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
