Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hello perl monks and wisefolks,
I need some help with a regular expression I have a file that has the following strings that I need to match (Query strings) file1: GCGAT, CACGT The target strings are in file2, against which the query strings need to be matched GNGATNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN GCGANBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB CNCGTNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN The condition for match is that: 1. Each of the query strings should be matched only in the beginning of the string 2. The query strings can have an N at any position which means for each query string eg. GCGAT we can have NCGAT,GNGAT,GCNAT,GCGNT,GCGAN. So any of these strings should be matched with the target strings. How do I make a regular expression that can contain all the 6 possibilities(includes the original string, GCGAT). I have the following code so far: Thanks in advance, biobee In reply to string match using with an N in any position by biobee07
|
|