Just another Perl shrine | |
PerlMonks |
Re^2: Matching in huge filesby dws (Chancellor) |
on Oct 13, 2004 at 23:38 UTC ( [id://399055]=note: print w/replies, xml ) | Need Help?? |
how can this be changed to correctly handle potential matches that overlap? How would you handle overlapping matches in a smaller string? The easiest approach is to apply each pattern to the string in serial. The slightly more complicated fix is to "back up" (via pos()) the length of the match - 1, then proceed with matching all in parallel. Either approach would work here. It comes down to your specific requirements.
In Section
Code Catacombs
|
|