Checked for null return from RegExp.exec()