Group(), Groups() & Groupdict()

  • + 0 comments
    import re
    print((m := re.search(r"([a-zA-Z0-9])\1", input())) and m.group(1) or -1)