From 58065f83d54ae18b8abd00d158e1942a01eede5c Mon Sep 17 00:00:00 2001 From: tolyo Date: Mon, 10 Mar 2025 15:44:54 +0200 Subject: [PATCH] Potential fix for code scanning alert no. 451: Inefficient regular expression Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- src/router/url/url-matcher.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/router/url/url-matcher.js b/src/router/url/url-matcher.js index c8da9ab56..bf72e58c3 100644 --- a/src/router/url/url-matcher.js +++ b/src/router/url/url-matcher.js @@ -209,7 +209,7 @@ export class UrlMatcher { const placeholder = /([:*])([\w[\]]+)|\{([\w[\]]+)(?::\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g; const searchPlaceholder = - /([:]?)([\w[\].-]+)|\{([\w[\].-]+)(?::\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g; + /([:]?)([\w[\].-]+)|\{([\w[\].-]+)(?::\s*((?:[^{\\}]+|\\.|{(?:[^{\\}]+|\\.)*})+))?\}/g; const patterns = []; let last = 0; let matchArray;