perl -wMstrict -le "my $c = qr{ (?> -- [^\n]* (?:\n|\z)) }xms; my $str = qq(a --b x\n x); print qq(match at positions $-[1]-), $+[1]-1 if $str =~ m{ ($c* [ ] x) }xms; " match at positions 2-9 perl -wMstrict -le "my $c = qr{ (?> -- [^\n]* (?:\n|\z)) }xms; my $str = qq(a --b x\n x); print qq(match at positions $-[1]-), $+[1]-1 if $str =~ m{ ($c* x) }xms; " match at positions 6-6 perl -wMstrict -le "my $c = qr{ (?> -- [^\n]* (?:\n|\z)) }xms; my $str = qq(a --b x\n x); print qq(match at positions $-[1]-), $+[1]-1 if $str =~ m{ ($c* ^ [ ] x) }xms; " match at positions 2-9 perl -wMstrict -le "my $c = qr{ (?> -- [^\n]* (?:\n|\z)) }xms; my $str = qq(a --b x\n x); print qq(match at positions $-[1]-), $+[1]-1 if $str =~ m{ ($c* ^ x) }xms; "