Not sure if you require the square brackets in your result or not. Note that \w does not include a comma, and that there are, of course, many other ways to do it.# $_ is the default buffer and pattern space while(<DATA>){ /^(\[\w+\])(.+)/; my $prefix = $1; my $values = $2; print "prefix:$prefix values:$values\n"; }
In reply to Re: Store and match
by cdarke
in thread Store and match
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |