We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
is there a regex that can be used to check whether the provided string is in a format that can be parsed by this library?
for the purposes of using in a jsonschema
The text was updated successfully, but these errors were encountered:
For durations, here's what I came up with (newlines for clarity, remove them from the final regex):
(?:\d+\s*(?:years|year|y))?\s* (?:\d+\s*(?:months|month|M))?\s* (?:\d+\s*(?:weeks|week|w))?\s* (?:\d+\s*(?:hours|hour|hr|hrs|h))?\s* (?:\d+\s*(?:minutes|minute|min|mins|m))?\s* (?:\d+\s*(?:seconds|second|sec|secs|s))?\s* (?:\d+\s*(?:millis|msec|ms))?\s* (?:\d+\s*(?:usec|us))?\s* (?:\d+\s*(?:nanos|nsec|ns))?\s*
This isn't perfect, though, because it doesn't reject empty strings.
Sorry, something went wrong.
Ideally the regex would be a constant exported by the library itself.
I wonder if the maintainers would be open to a PR?
No branches or pull requests
is there a regex that can be used to check whether the provided string is in a format that can be parsed by this library?
for the purposes of using in a jsonschema
The text was updated successfully, but these errors were encountered: