sub tokenize_msg_w_lists { my ($msg) = @_; # define consitituent characters. my $con = 'A-Za-z0-9\'\$!,.-'; $msg =~ /([$con]+?)[,.]?(?![$con])/g; }