perl regex match word that could have multiple hyphens

I am having a difficult time trying to form a perl regular expression that would match a word (made up of alphanumeric characters and underscores) that contains multiple hyphens in different places. I can match with one hyphen, but when there are other hyphens I can not think of anything and have looked around the web and have found nothing that would work.

For example, the part of the regex I now have that will match with 1 hyphen is:  (\w+-*\w*)
This will match, for example, 'wry-29', but not 'wry-29_th-34'

What I am trying to match could have 4 or more hyphens scattered about in the 'word'.
I could just repeat the expression 4 times,  \w+-*\w*-*\w*-*\w*-*\w*, but there would end up being 5 hyphens in the next thing I work on, and I would like to find a more elegant solution.
vbaabvResearch ScientistAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
wilcoxonConnect With a Mentor Commented:
Use repetition of sets:
/\b[\w-]+\b/

Open in new window

0
 
vbaabvResearch ScientistAuthor Commented:
Works really well.  Great job !
0
All Courses

From novice to tech pro — start learning today.