From 9fdcc2677d36d7ef5cf6009ce043293b9ddbd6ca Mon Sep 17 00:00:00 2001 From: Alessandro Manias Date: Tue, 16 Feb 2021 11:49:19 +0100 Subject: [PATCH 1/2] Fixed regexp for named route --- lib/util/named-group-regexp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util/named-group-regexp.js b/lib/util/named-group-regexp.js index 0a927dd8..21cb03f1 100644 --- a/lib/util/named-group-regexp.js +++ b/lib/util/named-group-regexp.js @@ -14,7 +14,7 @@ const pattern = [ '[>\']', // Get everything up to the end of the capture group: this is the RegExp used // when matching URLs to this route, which we can use for validation purposes. - '([^\\)]*)', + '([^\\)]*(\))?)\??)', // Capture group end '\\)', ].join( '' ); From d61d8bf321cfadd585f27c4b208c7cfc1d0e6b36 Mon Sep 17 00:00:00 2001 From: Alessandro Manias Date: Tue, 16 Feb 2021 11:53:00 +0100 Subject: [PATCH 2/2] Fixed some copy an paste mistakes --- lib/util/named-group-regexp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util/named-group-regexp.js b/lib/util/named-group-regexp.js index 21cb03f1..3eaeb787 100644 --- a/lib/util/named-group-regexp.js +++ b/lib/util/named-group-regexp.js @@ -14,7 +14,7 @@ const pattern = [ '[>\']', // Get everything up to the end of the capture group: this is the RegExp used // when matching URLs to this route, which we can use for validation purposes. - '([^\\)]*(\))?)\??)', + '([^\\)]*(\\))?)\\??', // Capture group end '\\)', ].join( '' );