I simply added the quotes and its showing data for both regex matches.
Working code:perl -nle ' print "$1$2" if /name=(\w+).*age=(\d+)/' filename
In reply to Re^2: One Liner, print multiple regex matches
by cipher
in thread One Liner, print multiple regex matches
by cipher
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |