import re
data = "[json][17:50 timestamp] hello [mike18][18:06 timestamp] hi"
print( re.split("\[(.*?)\]\[(.*?)\][^a-zA-Z0-9_]", data) )
The result I expected is:
["[json][17:50 timestamp] hello", "[mike18][18:06 timestamp] hi"]
But the real result is:
['', 'json', '17:50 timestamp', 'hello ', 'mike18', '18:06 timestamp', 'hi']
What regular expression should I use?