improved regexp for extracting grades