From 2f0212fb1f9067bd3498a675213f91be05dadd35 Mon Sep 17 00:00:00 2001 From: Melissa Alvarez Date: Tue, 2 Mar 2021 17:55:08 -0500 Subject: [PATCH] ensure regex works for filter with optional multiple spaces (#93071) (#93313) --- .../components/exploration_query_bar/exploration_query_bar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_query_bar/exploration_query_bar.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_query_bar/exploration_query_bar.tsx index dd451958e2646..3ef6dbc292c08 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_query_bar/exploration_query_bar.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/exploration_query_bar/exploration_query_bar.tsx @@ -60,7 +60,7 @@ export const ExplorationQueryBar: FC = ({ const searchChangeHandler = (q: Query) => setSearchInput(q); - const regex = useMemo(() => new RegExp(`${filters?.columnId}\s?:\s?(true|false)`, 'g'), [ + const regex = useMemo(() => new RegExp(`${filters?.columnId}\\s*:\\s*(true|false)`, 'g'), [ filters?.columnId, ]);