in reply to
What I understand from your question that you want to find string between two primers, now the two primers shown by you is actually having no string in between them, so I changed it little bit in this way AATCGGGTATGAAAAATTTxyzTGCCGGCGTTTGCG now the text you'll get in between these two primers is xyz. Try the following code and it'll work fine.
$a = 'AATCGGGTATGAAAAATTTxyzTGCCGGCGTTTGCG';
print "The variable is $1";
Let me know if your question is different than this.