Skip to content
Discussion options

You must be logged in to vote

This works!

z.optional(z.string()
.min(2, TOO_SHORT_COMPANY)
.max(40, TOO_LONG_COMPANY)
.regex(/^[0-9a-zA-Z]/,ALPHABET_NUMBER_ONLY_COMPANY))

CodeSandBox

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@lgj9172
Comment options

@lgj9172
Comment options

@lgj9172
Comment options

Answer selected by lgj9172
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants