From 653d515d32a1f396a0dd2612eebc2c529a799c5e Mon Sep 17 00:00:00 2001 From: Ray Vincent Date: Tue, 24 Aug 2021 13:43:00 -0700 Subject: [PATCH] Ensure that urn regex checks to end of string --- include/valijson/internal/uri.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/valijson/internal/uri.hpp b/include/valijson/internal/uri.hpp index 777ca2f..6adc1e7 100644 --- a/include/valijson/internal/uri.hpp +++ b/include/valijson/internal/uri.hpp @@ -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); }