From 41ee97a4f6e6b6c5c76d6b3f61fdeda5fbabe053 Mon Sep 17 00:00:00 2001
From: Aien Saidi <aien.saidi@gmail.com>
Date: Tue, 30 Mar 2021 19:10:23 +0200
Subject: fix: regex issue

---
 webui/src/pages/list/Filter.tsx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'webui/src/pages/list/Filter.tsx')

diff --git a/webui/src/pages/list/Filter.tsx b/webui/src/pages/list/Filter.tsx
index 42375dea..2e99eedf 100644
--- a/webui/src/pages/list/Filter.tsx
+++ b/webui/src/pages/list/Filter.tsx
@@ -35,7 +35,7 @@ function parse(query: string): Query {
   const params: Query = {};
 
   // TODO: support escaping without quotes
-  const re = /(\w+):([A-Za-z0-9-]+|"([^"]*)")/g;
+  const re = /(\w+):([A-Za-z0-9-]+|(["'])(([^\3]|\\.)*)\3)+/g;
   let matches;
   while ((matches = re.exec(query)) !== null) {
     if (!params[matches[1]]) {
@@ -43,8 +43,8 @@ function parse(query: string): Query {
     }
 
     let value;
-    if (matches[3]) {
-      value = matches[3];
+    if (matches[4]) {
+      value = matches[4];
     } else {
       value = matches[2];
     }
-- 
cgit 

