Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theepicsnail/50c3e907baa3abf1ff3a013f32ace8ff to your computer and use it in GitHub Desktop.
Save theepicsnail/50c3e907baa3abf1ff3a013f32ace8ff to your computer and use it in GitHub Desktop.
data =[
'Row: 1',
'Row: 1 Seat: 2',
'Row: 1 2 3 stuff blah Seat: Something else lalala ']
>>> [re.match("^Row: (.*?)(Seat: .*)?$", line).groups() for line in data]
[('1', None), ('1 ', 'Seat: 2'), ('1 2 3 stuff blah ', 'Seat: Something else lalala ')]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment