I am trying to find palindromic sequences within DNA by using recursion. I am doing this because it is impossible to know the exact length of a palindromic sequence within DNA. I have worked through the problem in my head and on paper, but the code below still does not come up with the answer I want it to. I am new to pyparsing and using CFGs. Therefore, I might be wrong with the way I set the code up. Any help would be welcome. 

```
stem = Forward()
atRule = Word("A") + ZeroOrMore(stem) + Word("T")
taRule = Word("T") + ZeroOrMore(stem) + Word("A")
gcRule = Word("G") + ZeroOrMore(stem) + Word("C")
cgRule = Word("C") + ZeroOrMore(stem) + Word("G")
stem << locatedExpr(Combine(atRule + taRule + gcRule + cgRule))
print(stem.parseString("AAAGGGCCCTTTAAAGGGCCCTTT"))

```