$teststring = 'blah not-so-good blah not-too-shabby '; while ($teststring =~ /([a-z]+-[a-z]+-[a-z]+)/gi) { print "$1\n"; }