code: def energy_string_to_float( string ):
      
      energy_re = re.compile( "(-?\d+\.\d+)" )
      return float( energy_re.match( string ).group(0) )
docs: Convert a string of a calculation energy, e.g. '-1.2345 eV' to a float.
  
      Args:
          string (str): The string to convert.
    
      Return
          (float)