import re str = "(f-dqcn-bus1),(f-cdqc-bus2)"businesses = re.findall(r"\w+(?=\))", str)print(businesses)
Standard input is empty
['bus1', 'bus2']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!