import res = 'This is *tag1* a test *tag2*.'print( re.findall(r'\*[^*]*\*|.', s, re.S) )
Standard input is empty
['T', 'h', 'i', 's', ' ', 'i', 's', ' ', '*tag1*', ' ', 'a', ' ', 't', 'e', 's', 't', ' ', '*tag2*', '.']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!