Or Maybe this:
Outputuse warnings; use strict; my $str = 'dog dog dog dog dog'; print join " " => ( split /\s+/, $str )[ 0 .. 2 ];
In reply to Re^2: Limiting number of regex matches
by 2teez
in thread Limiting number of regex matches
by eversuhoshin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |