Typescript String Match Object Is Possibly Null Or Undefined