Adding validity checker for chemical formula format.