I have a string that looks like this:
STRING 1 160 Some descriptor information. /Uselessstuff.; STRING 161 274 Some other descriptor information. /Moreuselessstuff.; STRING 275 1070 Last descriptor info. /Lastuselesspart.
Now I would like to extract the two integers and the information that follows up to the period then ignore the everything till either the end of the string or till the semicolon. So I would hope to end up with:
[('1', '160', 'Some descriptor information'), ('161', '274', 'Some other descriptor information'), ('275', '1070', 'Last descriptor info')]
I've tried:
import re
s = "STRING 1 160 Some descriptor information. /Uselessstuff.; STRING 161 274 Some other descriptor information. /Moreuselessstuff.; STRING 275 1070 Last descriptor info. /Lastuselesspart."
re.findall(r'(\d+)\s(\d+)\s(\w+)', s)
However, this only gives the following:
[('1', '160', 'Some'), ('161', '274', 'Some'), ('275', '1070', 'Last')]
How can I get the rest of the information up to the period?