fork(1) download
  1. import re
  2.  
  3. s = "qwop(8) 5"
  4. regex = re.compile("\((\d)\)")
  5. match = re.search(regex, s) # match object has span = (4, 7)
  6. if match:
  7. print(match.group(1))
Success #stdin #stdout 0s 23304KB
stdin
Standard input is empty
stdout
8