The
* and the
+ swallow up all of the o's and replace them with a single
e. This is called greediness, meaning that a pattern will match as much of a string as it can, maximizing the length of the pattern matched.
If you want ungreedy operators that work in the opposite way, use
*? and
+?. In your simple situation, a
e+? is as good as a plain old
e, so it's not really necessary. The added ? becomes more useful with character sets like
[aeiou] for example. You might also want to see the perl man page on regular expressions (
perlre) for more info.