import res="ZAp0ZuZAuX0AZA"for m in re.finditer(r'(?<!0)([A-Z]).*?(?<!0)\1', s): print(m.group())
Standard input is empty
ZAp0ZuZ AuX0AZA
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!