in reply to Regex - substitute

Perl RE's match "leftmost, longest". "Leftmost" takes precedence over "longest". /o*/ can match zero characters, as you said, and the leftmost place it finds 0 characters is right at the start of the string.