in reply to Regex: save values

As already mentioned, it's related to the capture orders. You can use ?: to just do clustering and not capturing to make it easier/clearer (see perldoc perlre):
if ( /(ct(?:a|g)a(?:c|t))(.{20,50})$/i ){ $branch = $1; # this will be 'ctXaX' $pyrich = $2; # this will be the 20-50 chars at the end }

Replies are listed 'Best First'.
Re^2: Regex: save values
by Anonymous Monk on Jun 13, 2005 at 08:53 UTC
    Oh dear... you all are so right. It was intended to be
    /(ct(?:a|g)a(?:c|t))(.{20,50})$/i
    of course... you sometimes need the help of others to see clear... LOL