in reply to pattern match, speed problem

Your /g flag is making each match start looking only after where the previous one left off. Is this intentional?