http://www.perlmonks.org?node_id=161015

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Might someone explain this little oddity.
$_ = "is this odd or not?"; @a = /(.*? )/gs; # note the ? is followed by a space print "@a";

It only gives one match here (5.6.1, linux). With only /g it matches multiple times. It also matches multiple times with /gsi, but not with combinations of /gs and other modifiers. It does multiple matches if you replace the trailing space in the re with a \s though.