Created
May 31, 2016 20:00
-
-
Save theepicsnail/50c3e907baa3abf1ff3a013f32ace8ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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