I have 2 RegExps. How can I get the start position of first RegExp matched substring and start to find second RegExp matching from this position?
UPD: For example:
$_ = "
=cut
vffdv
vdfvfd
vdfvfdvfd
=pod
dvfddv
vfdvfdvf
vdfvfdvfd
=end
";
$\ = "\n";
sub get {
my $_ = shift;
/=((\d|\w)+)/i;
return $1;
}
print get($_) while /^=/mg;
Prints
cut
cut
cut
But I need
cut
pod
end