From a7f9dbf4ea389343c7bc8ad2a97a7fbf32fcc994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=A4der?= Date: Wed, 20 Nov 2019 16:10:23 +0100 Subject: [PATCH] Don't use lookbehind regex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Mäder --- .../plugin-metrics/src/browser/plugin-metrics-creator.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/plugin-metrics/src/browser/plugin-metrics-creator.ts b/packages/plugin-metrics/src/browser/plugin-metrics-creator.ts index 816061f58468d..e593acceb2a30 100644 --- a/packages/plugin-metrics/src/browser/plugin-metrics-creator.ts +++ b/packages/plugin-metrics/src/browser/plugin-metrics-creator.ts @@ -26,7 +26,7 @@ export class PluginMetricsCreator { private _extensionIDAnalytics: MetricsMap; - private NODE_BASED_REGEX = /(?<=Request)(.*?)(?=failed)/; + private NODE_BASED_REGEX = /Request(.*?)failed/; constructor() { this.setPluginMetrics(); @@ -182,9 +182,8 @@ export class PluginMetricsCreator { } const matches = errorContents.match(this.NODE_BASED_REGEX); if (matches) { - return matches[0].trim(); + return matches[1].trim(); } return undefined; } - }