fork download
  1. import re
  2. regex = r"\bE\([A-Z]+\)(.*)"
  3. test_str = "SCF Done: E(RHF) = -75.5859595965 A.U. after 10 cycles"
  4. print(re.search(regex, test_str).group(1))
  5.  
Success #stdin #stdout 0.01s 9024KB
stdin
Standard input is empty
stdout
 = -75.5859595965 A.U. after 10 cycles