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.
In reply to Re: Extracting multiple matches from Reg Ex
by perlpie
in thread Extracting multiple matches from Reg Ex
by rookie_monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |