regex improved and validator object added