(It's really been quite a lookbehind kind of day :)my $tempstr = $str; # get rid of () around status $tempstr =~ s/^([^(:]+)\(([^)]+)\)/$1$2/; # grab the status and anything in parentheses @needed = $tempstr =~ /(^[^:]+|(?<=\()[^)]+(?=\)))/g;
Update: or do it the other way around:
@needed = $_ =~ /(^[^:]+|(?<=\()[^)]+(?=\)))/g; $needed[0] =~ y/()//d;
In reply to Re: String parsing
by ysth
in thread String parsing
by hotshot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |