Check for nullity along with regex in an effort to improve performance