in reply to Re^13: Comparing 2 different-sized strings
in thread Comparing 2 different-sized strings

I would use the regular expression except the problem is that there may be up to 2 mismatches in $nee1 and/or $nee2. In that case I need to use the fuzzyMatch subroutine don't I? Is there a way to incorporate the fuzzyMatch subroutine, which is perfect for mismatches, into the regular expression?
  • Comment on Re^14: Comparing 2 different-sized strings

Replies are listed 'Best First'.
Re^15: Comparing 2 different-sized strings
by BrowserUk (Patriarch) on Aug 18, 2013 at 19:30 UTC

    Try:

    my $hay = ...; my $nee = 'AGGATACGCCAC'; substr( $hay, $_+4, 1 ) eq 'T' and print substr( $hay, $_, length( $n +ee ) ) for fuzzyMatch( \$hay, \$nee, 3 );

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Thank you, but does this incorporate both $nee1 and $nee2 in this case where there are 2 sequences to search for?
        Thank you, but does this incorporate both $nee1 and $nee2 in this case where there are 2 sequences to search for?

        You said:

        $nee1 = AGGA $nee2 = CGCCAC #What I want is the following in regular expression: $hay =~ /($nee1)T[ATGC]($nee2)/

        I used:

        my $nee = 'AGGATACGCCAC'; ## $nee1 ^^^^ ## T? ^^ ## $nee2 ^^^^^^

        What do you think the answer to your question is?


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.