in reply to Question on conditional regular expressions/backreferences

In the general case your problem is ugly to solve with regexes because, from a computer science point of view, you don't need regular expressions but a (deterministic) context-free language.

If the number of possible outcomes is small, you can just construct an alternation manually:

/ACATGT|GCATGC/
If you have larger sets of alternations, your best bet is to assemble the alternatives with a program (perl 5.10 has very good optimizations for larger sets of constant alternatives), or to use assertions like this:
our %map = ( A => 'T', C => 'C' ); /([AC])CATC(??{$map{$1})/

(Untested). But if you do the latter, please read the warnings in perlre first, (??{...}) is an experimental feature.

This one captures the result from the [AC] in the variable $1 and then matches against a transformed version of that.