Check if preg_match actually machts

If there is an error in the header format, else it would give an array index error.