fix regex for matching errors and warnings