-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Feature: String starts/ends with #604
Comments
You can already do that: z.string().length(7).regex(/^#/); |
Even though this is doable with regexes, it's also a one-line addition to |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
An updated version if you need supporting 3 and 8 digit hex too
in case helps anyone looking for this |
I was writing a validator for a hex color code and thought that being able to check that it started with a
#
would be a nice addition.E.g.:
z.string().length(7).startsWith('#')
The text was updated successfully, but these errors were encountered: