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

URL Regex rejects valid urls #3

Closed
rperce opened this issue Jun 24, 2023 · 1 comment
Closed

URL Regex rejects valid urls #3

rperce opened this issue Jun 24, 2023 · 1 comment

Comments

@rperce
Copy link

rperce commented Jun 24, 2023

The url regex at time of writing is (https?://.*?)/(\w+)$. The last segment is required to be only word characters, which, notably, excludes hyphens and other symbols that are perfectly valid in URLs. In particular, I always generate a UUID for my ntfy topics, which have a dash in them. Swapping out \w for . would do, or if you really want to be precise, the valid characters for a url path, except for slash, are [-a-zA-Z0-9()@:%_\+.~#?&=].

@academo
Copy link
Owner

academo commented Jul 24, 2023

Thanks for the tip. afc2f26

@academo academo closed this as completed Jul 24, 2023
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

2 participants