in reply to Store and match
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"; }
|
|---|