Forum Moderators: coopster
([a-z0-9]+-?)+[a-z0-9]+
1. Allows alphanumeric input;
2. An OPTION of one or more embedded hyphens (hyphens can delimit the alphanumeric input but can't be leading or trailing).
3. The input must be a be a minimum of 2 alphanumeric characters long such as: ab or a-b.
/\w[\w-]*\w/
If you do need to exclude multi-hyphens (say, -- occurs in other directories that you don't want to match): /(?:\w+-?)+\w+/
There will be a final single-character hiccup on the last \w but that's no biggie.