No such thing as a small change | |
PerlMonks |
Re: string match using with an N in any positionby pvaldes (Chaplain) |
on Nov 18, 2011 at 18:10 UTC ( [id://938894]=note: print w/replies, xml ) | Need Help?? |
Just one more, not necessarily better or quicker than the other solutions if($value =~ m/^(NCGAT|GNGAT|GCNAT|GCGNT|GCGAN|NACGT|CNCGT|CANGT|CACNT|CACGTN).*?$/){do something...}1. Each of the query strings should be matched only in the beginning of the string 2. The query strings can have an N (and ONLY ONE?) at any position which means for each query string eg. GCGAT we can have NCGAT,GNGAT,GCNAT,GCGNT,GCGAN.
In Section
Seekers of Perl Wisdom
|
|