in reply to Extracting multiple matches from Reg Ex
my($text) = "(network)(test)(ifcfg)"; my(@matches) = ($text =~ m/\((.*?)\)/g); print "The following @{[ $#matches+1 ]} matches were found:\n"; print join(' and ', @matches) . "\n";
Just tweaking the version dasgar provided to remove a variable and generate the output in your original question.
|
|---|