in reply to Regular Expression to find Word Prefixes

Well, if you can assume that the data will always follow the pattern you presented, then you can split on a space:
my @words=( "12 chem1", "1/2 chem2", "(N+1) chem3", "2M chem4", "N chem5" ); # given an array of words, returns an # array of corresponding prefixes sub get_prefixes { map { (split)[0] } @_; } print join(",",get_prefixes(@words));
-Vlad