Author flox
Recipients effbot, flox, pitrou
Date 2009-12-31.10:03:44
SpamBayes Score 0.0657928
Marked as misclassified No
Message-id <1262253826.13.0.505980552757.issue7462@psf.upfronthosting.co.za>
In-reply-to
Content
I checked the code, and it is the right thing:

Example 1 (fastsearch):

s, p = "ABCDEABCF", "BCD"
s.rfind(p)

# i = 6  is first candidate, but "BCF" != "BCD"
# then s[i-1] = "A" is not part of pattern
# so we skip 3 chars: next loop is i = 2
# etc...


Example 2 (msg97039):

s, p = "ABCDBCBCF", "BCB"
s.rfind(p)

# i = 6  is first candidate, but "BCF" != "BCB"
# then s[i-m] = "D" is not part of pattern
# so we skip 3 chars: next loop is i = 2.. and it fails!

I've tested many examples to understand and verify the algorithm.
History
Date User Action Args
2009-12-31 10:03:46floxsetrecipients: + flox, effbot, pitrou
2009-12-31 10:03:46floxsetmessageid: <1262253826.13.0.505980552757.issue7462@psf.upfronthosting.co.za>
2009-12-31 10:03:44floxlinkissue7462 messages
2009-12-31 10:03:44floxcreate