... to improve on it. If I were going to optimize anything the first would be to keep track of the offset into the string, instead of trimming the front off the input strings after each match. As is, I often return an array of strings of 15,000 to 20,000 at a time, parsing various logs and xml ...