I have a field which should only take values divisible of 12. Such as 12,24,36,48,60,72,84,96,108,120. I used below regex :
12|24|36|48|60|72|84|96|108|120 But this also allows values such as 12abc, 12-!&. It's allowing alphabets or special characters with the numbers. Is there any regex to only allow 12,24,36,48,60,72,84,96,108,120 as input.
^(12|24|36|48|60|72|84|96|108|120)$, but in general I think @Pointy is right.