Just another Perl shrine | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
If one could run the match engine "backwards" and match a string in reverse, i.e., from end to beginning, that might solve your problem. Unfortunately, there's no m//r modifier that I'm aware of. One might do a match against a reversed string: Incrementally building and maintaining a reversed string for each "forward" string might not be too expensive even for hundreds of strings of thousands of characters. Unfortunately, you now have the problem of finding some way to persuade the "software" to generate an arbitrary regex backwards, so that, e.g., X .* Y becomes Y .* X (but that's just a small matter of programming, right? :). BTW: Is it possible for you to suppress re-compilation of the regex on every match, perhaps with the m//o modifier? That might speed up matching in general and at least alleviate your problem. Give a man a fish: <%-{-{-{-< In reply to Re: Growing strings in search
by AnomalousMonk
|
|