Validation regex not working
Community Alums
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2024 08:09 PM
Hi all,
Im trying to create a validation regex for a string field
regex is :
^([a-zA-Z\d]{2}[-.][a-zA-Z\d]{4}[-.][a-zA-Z\d]{4}[-.][a-zA-Z\d]{3}|[a-zA-Z\d]{6}[-.][a-zA-Z\d]{3}[-.][a-zA-Z\d]{4}[-.][a-zA-Z\d]{1})$
The requirement is it should allow both formats below, and can contain numbers and letters(case insensitive) and delimters can be - or .
xx-xxxx-xxxx-xxx
xxxxxx-xxx-xxxx-x
when I run the above regex in background script, it works fine. But not in catalog item in portal
Can someone suggest me a solution, please
Thanks
Bimsari
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2024 11:35 PM
Hi @Community Alums
As @Mark Roethof told, your regex is working as expected. I tried simulating this issue on my PDI and it worked as expected. Refer below steps and check if you missed anything :
1. Setup the Regex :
2. Link it to your variable :
Output :
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.