import repattern = re.compile(r"\s*([^[\],]+)")string = '[ 1234, jack, 1987-09-02]'ret = pattern.findall(string)print(ret)
Standard input is empty
['1234', 'jack', '1987-09-02']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!