- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2022 03:03 AM
Hi All,
I have a requirement where field value should be restricted to 6 and out of which first two should be alphabet and last 4 to be numeric. In the alphabet part input can only be LP or DP.
eg. LP1000(any 4numeric value is ok) and DP8765
no restriction is there for numeric part, it can be any numeric value. Alphabet should be LP or DP. Can anyone help me for writing regex for this ?
Thanks in Advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2022 03:33 AM
Hi Priya,
If you are doing this on catalog item, Create a regex in variable validation regex table.
And use this logic:
^[LP|DP]{2}[0-9]{4}$
And in the variable attributes set this:
max_length=6 //so that user cannot enter more than 6 letters
(=tested)
Hope it helps.
Thanks,
Murthy
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2022 04:48 AM
Glad to help:)
Murthy