Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 9
    This is not a job for a regex. Commented Aug 9, 2019 at 15:05
  • 2
    if you only need those specific numbers you could put a start and end char to the regex ^(12|24|36|48|60|72|84|96|108|120)$, but in general I think @Pointy is right. Commented Aug 9, 2019 at 15:07
  • function isValid (input){ return (input % 12 === 0) && (input>11) && (input<121); } function doingStuffWithInput(input) { if (isValid(input)){ //do stuff } else{ alert("error, not valid"); } If you wish to do it without regex Commented Aug 9, 2019 at 15:13
  • This page about anchors might be helpful rexegg.com/regex-anchors.html Commented Aug 9, 2019 at 15:16
  • @Onheiron thanks it worked Commented Aug 9, 2019 at 15:34