- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2020 07:20 AM
Hi all,
I have a Validation regex for a field within a catalogue item.
It currently does not allow the characters [^"();:<>]+ which works fine.
But now I need to prevent spaces being entered at the beginning, middle or end, how can I do this?
Can I add some characters to the current regular expressions field?
I
Thanks in advance,
Usmaan.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2020 06:19 AM
Hi,
Above provided solution is also from Orlando.
To approach ServiceNow,
Create HI ticket.
https://hi.service-now.com/hisp
If it is ok for you can you share the PDI details on dhananjay.pawar1111@gmail.com I will check.
If possible share
Catalog item name and access details.
Thanks,
Dhananjay.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2021 03:46 AM
Feedback from support.
The PRB: PRB1460322 attached on the Case, has been reviewed by DEV team and they have closed it as "Working as Expected" for the following reason:
"The behavior: "Variable validation for Regex is not showing error in SP": is due to the form control input in Angular, which by default trims if the value contains any leading or trailing spaces as per the design of the Platform.
The only difference is it does not show any error."

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2020 05:15 AM
Hi Usmann,
Please try this:
pattern = /^[0-9a-zA-Z]*$/;
Kindly mark this answer helpful and correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2020 06:12 AM
does not work on leading and trailing spaces.