How to re.search() multiple patterns in python?

Viewed 3533

I have a list like this:

['t__f326ea56',
 'foo\tbar\tquax',
 'some\ts\tstring']

I want to get results in 4 different variables like this:

s1 = 't__f326ea56'
s2 = ['foo', 'some']
s3 = ['bar', 's']
s4 = ['quax', 'string']

Normally I could do a search like re.search(r'(.*)\t(.*)\t(.*)', lst).group(i) to get the s2, s3, s4. But I can't do simultaneous search for all 4. Is there any special option in re module that I can use?

Thanks

2 Answers
Related