Oh I see. That's more difficult since perl's regex engine is designed to stop anytime it finds a match. You're after every possible match which is something I hear a POSIX regex engine will do by default. I'd be wary of trying to trick perl's engine with your trailing (?!) because the thing is designed to try to stop early and IIRC will try to avoid branches when possible, especially exponential permutations which is what you're after. Perhaps you should write your program in a language that has a POSIX engine instead.
|