Adding check for null regex matches