re.findall ваш друг здесь:
re.findall
>>> import re >>> sample = "[xy][abc]" >>> re.findall(r'\[([^]]*)\]',sample) ['xy', 'abc']