Skip to content

Commit

Permalink
Don't use lookbehind regex
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Mäder <tmader@redhat.com>
  • Loading branch information
tsmaeder authored and akosyakov committed Feb 24, 2020
1 parent 07d089a commit a7f9dbf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/plugin-metrics/src/browser/plugin-metrics-creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}

}

0 comments on commit a7f9dbf

Please sign in to comment.