import re s="311102Z/5663.00N/00813.02E/GPS//03/-/"pattern = r"[^/]+(?=/)|(?<=/)(?=/)"print(re.findall(pattern, s))
Standard input is empty
['311102Z', '5663.00N', '00813.02E', 'GPS', '', '03', '-']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!