write a regex pattern to match even number of letter `A`,re.compile('^([^A]*)AA([^A]|AA)*$')