I'm not sure whether I've understood your problem. Can it be that your problem is solved using backreferences in the split// regexp?
@stuff = split m{ <!--end--> <a \s name=" ( \d+ ) "></a> <!--start--> }x => $data;
See `perldoc -f split` to see what happens with your backreference $1.
Another option is to use a parsing while(REGEXP):
--while( $data =~ m{ \G <a \s+ href = " (\d+) "></a> <!--start--> ( .+? ) <!--end--> }xg ){ my $number = $1; my $data = $2; #... }
In reply to Re: Split with data keep
by fruiture
in thread Split with data keep
by Kage
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |