Ensure that urn regex checks to end of string

This commit is contained in:
Ray Vincent 2021-08-24 13:43:00 -07:00
parent eac0859cd8
commit 653d515d32

View File

@ -28,7 +28,7 @@ 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}");
"*+,;:=]+){0,1}(#[-a-zA-Z0-9\\\\._~%!$&'()\\/*+,;:=]+){0,1}$");
return std::regex_match(documentUri, pattern);
}