Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 12:26 < proprietarysucks> I want to get the second part of this: name "something" -> I want the 'something'. I tried this, but the line starts with whitespace, so
- this matches other wrong lines too: match = re.search('(?<=name ")[^"]+', line)
- 12:27 < proprietarysucks> so then I changed it to match = re.search('(?<=^\s+name ")[^"]+', line) which just complains and dies
- 12:28 < proprietarysucks> then I changed to just match = re.search('^\s+name', line) for a test, but this is just returning 'name'
- 12:28 < proprietarysucks> name "something i care about"
- 12:29 < proprietarysucks> awesome name "blah" line that I don't care about
- 12:29 < proprietarysucks> what am I missing here on how to get 'something i care about' from the top line and not match the second
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement