mirror of
https://github.com/tristanpenman/valijson.git
synced 2024-12-13 10:32:58 +01:00
Update urn regex to match widely accepted expression
This commit is contained in:
parent
653d515d32
commit
f787a8a7a7
@ -26,9 +26,7 @@ inline bool isUriAbsolute(const std::string &documentUri)
|
||||
*/
|
||||
inline bool isUrn(const std::string &documentUri) {
|
||||
static const std::regex pattern(
|
||||
"^((urn)|(URN)):[a-zA-Z0-9]+[-]{0,1}[a-zA-Z0-9]+(:[-a-zA-Z0-9\\\\._~%!"
|
||||
"$&'()\\/*+,;=]+)+(\\?[-a-zA-Z0-9\\\\._~%!$&'()\\/"
|
||||
"*+,;:=]+){0,1}(#[-a-zA-Z0-9\\\\._~%!$&'()\\/*+,;:=]+){0,1}$");
|
||||
"^(?i:urn:(?!urn:)([a-z0-9][a-z0-9-]{1,31}):((?:[-a-z0-9()+,.:=@;$_!*'&~\\/]|%[0-9a-f]{2})+)(?:\\?\\+(.*?))?(?:\\?=(.*?))?(?:#(.*?))?)$");
|
||||
|
||||
return std::regex_match(documentUri, pattern);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user