This should work:
^([a-zA-Z0-9]-[a-zA-Z0-9])+$ Also if you want to have exactly 135 hyphens:
^([a-zA-Z0-9]-[a-zA-Z0-9]){135}$ or if you want to have at least 23 hyphens but not more than 54 hyphens:
^([a-zA-Z0-9]-[a-zA-Z0-9]){23,54}$