[Bioperl-l] Sequence matching problem!
Kurt Gobain
enrique_rulz at yahoo.com
Thu Feb 22 20:41:37 UTC 2007
Hi every1..
I m facing a great deal of problem in simple pattern matching between
sequence & a pattern ..Program shod be designed such a way that it shod be
able do two things 1) normal matching...For eg: GATCAAT....if TC is
entered... output shod be 2...2) matching using spl character..In same
example if C*T value is entered It shod give o/p as 3 & seq to b displayed
is CAAT..I m easily getting 1st part...But in 2nd part Its giving sum
problem..output I m gettin as 1 instead of 3...Code is really simple!
#!/usr/bin/perl
$alphabet = "GATCAAT";
$pattern= "C*T ";
$alphabet =~ /($pattern)/i;
print "The entire '$pattern' match began at $-[0] and ended at $+[0]\n";
====================
OUTPUT!
The entire C*T match began at 1 and ended at 2
====================
but the o/p shod be 3????
& Is there n e chance I can get seq too..I mean instead of C*T'' i need
'CAAT'...????
Well..Its not compulsion to use regex....But I find it quite simple..can
there be n e other method??
Thanx in advance!
Kurt!
--
View this message in context: http://www.nabble.com/Sequence-matching-problem%21-tf3275153.html#a9107936
Sent from the Perl - Bioperl-L mailing list archive at Nabble.com.
More information about the Bioperl-l
mailing list