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

Expand regex for absolute IRIs #177

Merged
merged 1 commit into from
Aug 10, 2024
Merged

Conversation

balhoff
Copy link
Contributor

@balhoff balhoff commented Aug 9, 2024

Fixes #176.

I updated to the regex to match the grammar in https://www.ietf.org/rfc/rfc2396.txt:

Scheme names consist of a sequence of characters beginning with a
lower case letter and followed by any combination of lower case
letters, digits, plus ("+"), period ("."), or hyphen ("-"). For
resiliency, programs interpreting URI should treat upper case letters
as equivalent to lower case in scheme names (e.g., allow "HTTP" as
well as "http").

 scheme        = alpha *( alpha | digit | "+" | "-" | "." )

@RubenVerborgh RubenVerborgh self-assigned this Aug 10, 2024
@RubenVerborgh
Copy link
Owner

RubenVerborgh commented Aug 10, 2024

Thanks @balhoff, good catch! Your code is correct; I just slightly changed the order from a-z0-9.-+ to a-z0-9.+- so readers don't confuse it as "a to z, 0 to 9, dot to plus".

@RubenVerborgh RubenVerborgh merged commit 9eb98a5 into RubenVerborgh:main Aug 10, 2024
0 of 4 checks passed
@balhoff
Copy link
Contributor Author

balhoff commented Aug 12, 2024

Thanks @balhoff, good catch! Your code is correct; I just slightly changed the order from a-z0-9.-+ to a-z0-9.+- so readers don't confuse it as "a to z, 0 to 9, dot to plus".

Good idea, thank you!

@balhoff balhoff deleted the patch-1 branch August 12, 2024 13:44
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

Successfully merging this pull request may close these issues.

URI schemes containing digits cause parse error
2 participants