我有下面这样的文本:
00:00 stuff 00:01 more stuff multi line and going 00:02 still have
因此,我没有块结束标记,只有一个新的块开始标记。
我想递归地获取所有的块:
下面的代码只会给我这个结果:1 = 00:00 stuff 2 = 00:01 more stuff multi line and going
$VAR1 = '00:00';
$VAR2 = '';
$VAR3 = '00:01';
$VAR4 = '';
$VAR5 = '00:02';
$VAR6 = '';
我做错了什么?
my $text = '00:00 stuff
00:01 more stuff
multi line
and going
00:02 still
have
';
my @array = $text =~ m/^([0-9]{2}:[0-9]{2})(.*?)/gms;
print Dumper(@array);