sterben has asked for the wisdom of the Perl Monks concerning the following question:
By itself, it matches fine. However, I was wondering how I could force it to be palindromic; that is, if I match an 'A' with the first part then to force it to match a 'T' in the second. The best I've come up with so far is:/[AG]CATG[CT]/
which works ok. However, I was wondering if there is an easier/better way of doing this such that I don't have to try and match the entire sequence in the backreference and instead can just query the AG. Thank you for your time./[AG]CATG(?(?<=ACATG)T|C)/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Question on conditional regular expressions/backreferences
by moritz (Cardinal) on Jul 01, 2008 at 22:55 UTC |