regexp working, validate function