Check for NaN via isNaN() and compare regular expressions