in reply to Inefficient regex
An alternate approach is to break the input string into fragments, operate on the fragments, and then reassemble (i.e., join) an output string from fragments when you're finished.
My favorite tools for breaking a large string into pieces are the \G assertion, coupled with /c. Find both in perlre.
|
---|