I’m a bit puzzled with a particular regex that is seemingly simple.
The match must be a string with only a-z, A-Z, 0-9 and must have at least one occurence of the ‘-‘ character anywhere in the string.
I have [a-zA-Z0-9-]+ but the problem is, it will also match those without the ‘-‘ character.
ABC123-ABC //should match
ABC123ABC //shouldn't match.
This should work:
Also if you want to have exactly 135 hyphens:
or if you want to have at least 23 hyphens but not more than 54 hyphens:
You get the point 🙂