Add uri_rfc3986? matcher to support validating full URL #94
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I use
uri?
predicate to validate whether a string is an valid URI. However, this case fails:Upon reading code of
URI
module, I notice thatURI::DEFAULT_PARSER.make_regexp
creates a regex that matches only part of the string, and I have no way to avoid that behavior, aside from switching toURI::RFC3986_Parser::RFC3986_URI
:However, this prevent me from using the nice error message that comes with
uri?
predicate. I suppose some people would have the same problems as me, so I would like to contribute it back to the repo.I understand that changing
uri?
itself would be a breaking change, so I want to avoid that, and add a newuri_rfc3986?
predicate instead. If people start using it overuri?
, maybe we can consider deprecateuri?
and replace it withuri_rfc3986?
in v2.0.