Hi Shyam,
Please find one of my perl code to extract matching string region at http://bioinformaticsonline.com/file/view/4882/detect-the-sequence-pattern-and-its-location-in-fasta-file-with-match-and-mismatches-information
Hopefully this will be...
This script is one of my old script to detect some centromeric pattern in chromosomes. User can also control the number of mismatches allowed through command line ..
To run:
perl centro.pl
I found a really good resource for Artificial Intelligence in Bioinformatics @ http://www.aisb.org.uk/publications/proceedings/aisb2000/AISB00_Bioinformatics.pdf
If you don't mind using BioPerl, you can try Bio::Tools::SeqPattern module for this purpose http://doc.bioperl.org/releases/bioperl-1.4/Bio/Tools/SeqPattern.html
Hope helpful.
BestShreya