Skip to content
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

RegExp for validation? #50

Closed
stockholmux opened this issue Oct 6, 2015 · 4 comments
Closed

RegExp for validation? #50

stockholmux opened this issue Oct 6, 2015 · 4 comments

Comments

@stockholmux
Copy link

Is there a regular expression to validate CUIDs?

@hilkeheremans
Copy link

Check out https://github.com/smallhelm/is-cuid and https://www.npmjs.com/package/is-cuid

@stockholmux
Copy link
Author

Nice! This should be in the readme for this project - I would have never found this without your help.

@rsp
Copy link

rsp commented Sep 14, 2017

@stockholmux @hilkeheremans Note that is-cuid returns true for strings like this:

  • c:\autoexec.bat
  • comment=lorem+ipsum&json={"title":"Lorem","message":"Lorem%20ipsum%20dolor%20sit[...]"}

which I personally wouldn't consider a valid cuid.

See: https://runkit.com/rsp/59ba67877e8de600126d4b85

@hilkeheremans
Copy link

Yes, we noticed that as well recently. Thanks for mentioning!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants