http://www.perlmonks.org?node_id=318823


in reply to String parsing

my $tempstr = $str; # get rid of () around status $tempstr =~ s/^([^(:]+)\(([^)]+)\)/$1$2/; # grab the status and anything in parentheses @needed = $tempstr =~ /(^[^:]+|(?<=\()[^)]+(?=\)))/g;
(It's really been quite a lookbehind kind of day :)

Update: or do it the other way around:

@needed = $_ =~ /(^[^:]+|(?<=\()[^)]+(?=\)))/g; $needed[0] =~ y/()//d;