Well, there are several comments on how well this clas works, but I haven't found that to be the case. When I plug it in, it's leaking memory all over the place and appears to hosing memory it doen't own as well.
After I run a semi-complicated search such as "b+.txt" I get crashes all over the place because of memory inconsistencies.
I would like to be able to replace the Nth occurrence of a pattern in a string, and only the Nth.
I could potentially build my result by appending pieces of string up to the beginning of the Nth match, then replace it with whatever needed, and continue the construction of the final result by appending the remainder.
Although this would not be appropriate if the replacing string is complex (with remembered parethesized parts for example), it would be appreciable in this --still very good-- implementation.