in reply to Re^2: Parse a large string
in thread Parse a large string

Quite correct! As written the regex would match Nullamie as well as Nullam and the greediness would eat the first augue!

Another way to calm greediness is the the ? modifier, .+ is a maximal match, .+? is a minimal match, like: $data =~ /(Nullam\b.+?(?:augue|libero)\.)/g); That's sometimes a good way to go and would work if we didn't have the "." to help us out here. Although I like your [^.]+ your idea looks great to me! There is more than one way to skin these regex cats!