Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- def main(input_str):
- result = {}
- matches = re.findall(r"glob\s(-?\d+)\s*=>\s*q\((\w+)", input_str)
- for x in matches:
- key = x[1]
- value = x[0]
- result[key] = int(value)
- return result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement