Regex validation of inputs