regular expression - match
I'm struggling now for hours with this little piece of ... <br>

need to match an aplhanumeric word, it can contain "-" but not at the end or start and "-" must not be repeated (like "--")
<br>
and the word length must be between 2 and 24

some exemples:
adfg<br>
asd-asdasd<br>
asd-asd-asd<br>

and these should not be matched:
-asd<br>
asd-<br>
-asd-<br>
-asd--asd-<br>
regular expression - match
===

I'm struggling now for hours with this little piece of ... <br>

need to match an aplhanumeric word, it can contain "-" but not at the end or start and "-" must not be repeated (like "--")
<br>
and the word length must be between 2 and 24

some exemples:
adfg<br>
asd-asdasd<br>
asd-asd-asd<br>

and these should not be matched:
-asd<br>
asd-<br>
-asd-<br>
-asd--asd-<br>