[Bioperl-l] regular expression help!

Marc Logghe Marc.Logghe at devgen.com
Sat Jan 15 03:34:10 EST 2005


Hi,
In the part (??{$rev=reverse(\2 =~ tr/ATCG/TAGC/i);}) I have my doubts about the double question marks.
In case you don't want capturing braces and you want to execute code, I think it should look like:
(?:?{$rev=reverse(\2 =~ tr/ATCG/TAGC/i);})
In case you want to capture, then there is one ? too many because the syntax is '?{ code }' and not '??{ code }' for executing code in a regex.
HTH,
Marc 


-----Original Message-----
From: bioperl-l-bounces at portal.open-bio.org on behalf of Guojun Yang
Sent: Fri 1/14/2005 8:12 PM
To: bioperl-l at portal.open-bio.org
Subject: [Bioperl-l] regular expression help!
 
Hi, Everybody,
I was trying to use a regex recognizing a patter of inverted repeat DNA seq flanked by direct repeats (see below), it returns errors saying "(?{...}) not terminated or {...} not balanced. Can anybody help me sorting this out?
The regex I have is:
$regex =~ /\S+(\S+)(\S{10}).*(??{$rev=reverse(\2 =~ tr/ATCG/TAGC/i);})\1.*/i;
Thank you,
Yang


_______________________________________________
Bioperl-l mailing list
Bioperl-l at portal.open-bio.org
http://portal.open-bio.org/mailman/listinfo/bioperl-l






More information about the Bioperl-l mailing list