in reply to find the substring

Just a guess but if these are protein sequences, you might check BioPerl for a number of handy tools specifically designed for this application.