I do not understand this point in Larry's book on page 39:
The other point to be careful about is that regular expressions will try to match as early as possible. This even takes precedence over being greedy.
I have this example:
my $ih = 'fred xxxxxxx barney';
print $ih =~ /(.*x)/;
It could match fred x
which is earlier
then red xxxxxxx
but it matches the second possibility, which is greedy and not earliest. Why ?
EDIT