Just another Perl shrine | |
PerlMonks |
Re: Sorting words, keeping only words that start with a letter and contain only letter characters, and hypens, and end in a letterby Ido (Hermit) |
on Nov 10, 2002 at 22:52 UTC ( [id://211811]=note: print w/replies, xml ) | Need Help?? |
Sort is simply sort, that rest is a regex.
HTH Update: It's unclear whether you want words like 'b0n' (with characters that aren't letters in positions other than beginning and end), if you do, change the regex to: /^[a-zA-Z]([^-]*|-[^-])*(?<=[a-zA-Z])$/
In Section
Seekers of Perl Wisdom
|
|