Pattern matching problem

  • 15 years ago

    I am a complete beginner to perl so this may or may not be easy.


    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

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Engineers are all basically high-functioning autistics who have no idea how normal people do stuff.” - Cory Doctorow