fork download
  1. line = 'User Number 1 will probably like movie ID: RecommendedItem[item:557, value:7.32173]the most!'
  2. content = '557::Voyage to the Bottom of the Sea (1961)::Adventure|Sci-Fi'
  3. import re
  4. m = re.search(r'(?<=RecommendedItem\[item:)(\d+)',line)
  5. n = re.search(r'(?<=^'+m.group(0)+r'\:\:)(\w+)',content)
  6. print n.group()
Success #stdin #stdout 0.08s 8888KB
stdin
Standard input is empty
stdout
Voyage