import remy_regex = re.compile(r'\[([^][]+)\]')print(my_regex.findall('[xy][abc]'))
Standard input is empty
['xy', 'abc']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!