in reply to printing LAST_MATCH_START/@- LAST_MATCH_END/@+ array where regex match begin/end
#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11139917 use warnings; while( <DATA> ) { my @pos; push @pos, @-, @+ while /\t+/g; @pos or @pos = (-1) x 2; print "@pos\n"; } __DATA__ foo bar baz foo bar foo baz ccc ddd foo bar foo baz ccc ddd foo bar baz foo bar foo baz ccc ddd foo
In Section
Seekers of Perl Wisdom