sjossie has asked for the wisdom of the Perl Monks concerning the following question:
I have what is effectively a 31,367 word string called $sequences with each "word" separated by a normal space althogh these could be changes to #'s or any other delimiter if it were to make life easier. Some words are up to 26,000 characters long.
What I would like to do is look for the occurrence within any of the separate "words" of two strings $quart1 and $quart2 which may or may not overlap eg. ( cedftghyjhg) $quart1 = dftg $quart2= ftgh would still be a hit.
Is there some way of doing a pattern match across the whole string $sequences rather than dividing it up into single "words".
i.e of the form ...
if ($sequences =~ m/ \s .* (quart1 quart2)allowing for ovelap .* \s / ) {
Does this make any sense ???
many thanks for any tips
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pattern matching problem
by Perl Mouse (Chaplain) on Oct 12, 2005 at 15:26 UTC | |
|
Re: Pattern matching problem
by Roy Johnson (Monsignor) on Oct 12, 2005 at 15:32 UTC | |
|
Re: Pattern matching problem
by Zaxo (Archbishop) on Oct 12, 2005 at 15:47 UTC |