Regex to validate a catalog variable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 02:15 AM
Hi There,
I have a requirement to validate a catalog variable which the help of regex which should satisfy the below criteria.
Ex 1 : bldg724 - Meeting room
Ex 2 : bldgKN1 - Magnum
1. String should always start with bldg
2. Followed by exactly 3 characters ([0-9a-zA-Z])
3. Followed by a Space
4. Followed by a - (hyphen)
5. Followed by a Space
6. Followed by any string
If the above criteria doesn't match, throw an error. Please help me in building the regex.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 05:06 AM
pls try this.
^bldg[0-9a-zA-Z]{3} - .+$
Thanks
Harshad