-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prompt Validation: regex matching causes multiple rerenders on input #207
Comments
hi @jenil777007 did you find a solution to this issue? Something similar happens when the input exceeds the length of the terminal and starts a new line. |
config Templates in promptui.Prompt to control output content format,more detail please refer template |
Try this: emailPrompt := promptui.Prompt{
Label: "Email",
Validate: func(input string) error {
regex := regex.MustCompile(`([a-z]+)@email.com`)
if !regex.MatchString(input) {
return errors.New("Wrong mail format")
}
return nil
},
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue reproduction:
Issue:
The text was updated successfully, but these errors were encountered: