- or download this
my @sorted = sort grep /^[a-z](?:[^-]|-(?!-))*(?<=[a-z])$/i, @words;
- or download this
/^[a-z] # Start with a letter.
(?: # Start grouping.
...
)* # End group. Match 0 or more of those groups.
(?<=[a-z])$ # The end, as long as it is preceded by a letter.
/ix # Match case insensitively and allow comments.
- or download this
/^[a-z](?:[^-]|-(?!-))*[a-z]$/i