There should be some default values for doc_width and doc_height in case (for whatever reason) the regular expression doesn't match.  If that happens there would be an error here which we should handle more gracefully.