I don't know if anybody has a better solution, but you could just take two steps to both capture what you want to capture and split the string:
my $string = "uno abc dos"; my @a = split /abc/, $string; $string =~ /(abc)/; ...some use of $1...
If your pattern is just something as trivial as abc, you could just assume $1 = 'abc'...but I'm assuming it's not.
In reply to Re: Curios use of regular expressions in split
by Riales
in thread Curios use of regular expressions in split
by juliosergio
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |