add pattern regex validation to inputs