import reprint(re.compile(r'^[^\W_]+_+|[\W_]+').split('row_0007_id_testa_testb'))
Standard input is empty
['', '0007', 'id', 'testa', 'testb']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!