strg1 = r"""releasenotesforwildmagicversion01thiscdromcontainstheinitialreleaseofthesourcecodethataccompaniesthebook"3dgameenginedesign:apracticalapproachtorealtimecomputergraphics"thereareanumberofknownissuesaboutthecodeastheseissuesareaddressedtheupdatedcodewillbeavailableatthewebsitehttp://wwwmagicsoftwarecom/3dgameenginedesignhtmlbugssuggestionsforimprovementsandothercorrespondencecanbesenttosupport@magicsoftwarecomthecurrentknownissuesare1meshalgorithmforcontinuouslevelofdetailappearsnottobeworkingbase""" strg2 = r"""releasenotesforwildmagicversion02updatefromversion01toversion02ifyourcopyofthebookhasversion01andifyoudownloadedversion02fromthewebsitethenapplythefollowingdirectionsforinstallingtheupdateforalinuxinstallationseethesectionattheendofthisdocumentupdatedirectionsassumingthatthetopleveldirectoryiscalledmagicreplacebyyourtoplevelnameyoushouldhavetheversion01contentsinthislocation1deletethecontentsofmagic\include2deletethesubdirectorymagic\source\mgcapplication3deletetheobsoletefiles:amagic\source\mgc""" import sys print sys.version from difflib import SequenceMatcher as SM print "original len:", len(strg1), len(strg2) print strg2.count("0"), "instances of '0' in strg2" for tlen in (500, 499, 498): print "test len:", tlen smo = SM(None, strg1[:tlen], strg2[:tlen]) print smo.find_longest_match(0, tlen, 0, tlen) print smo.find_longest_match(0, tlen-1, 0, tlen-1) print smo.find_longest_match(0, 100, 0, 100) print smo.find_longest_match(1, 101, 1, 101) print smo.find_longest_match(2, 102, 2, 102)