[Bioperl-l] A pattern problem in Perl

darson darson at ha.mc.ntu.edu.tw
Thu May 1 12:12:05 EDT 2003


Hello,
     I encountered a problem. I try to grap the number from txt files
(bl2seqs report)
Those lines read as A:"Identities = 124/135 (91%), Gaps = 2/135 (1%)" or
just B:"Identities = 124/135 (91%)". Both types coexists.
I wrote the pattern matching script as "$judgecont=~m/Identities = (.*)\/.*?
\((.*)%\)/;"
My purpose is to grap the $1--(the numerator of fraction) and $2 (the
percentage of Identities not Gaps)
However according to the greed principle, I always gain the "1"(percentage
of gaps) as in A situation.
Any suggestion or guide?  Thank you very much!
                      Regards
                                               Darson 2003/05/01




More information about the Bioperl-l mailing list