Skip to content

Commit

Permalink
improve regex matching
Browse files Browse the repository at this point in the history
  • Loading branch information
hkfgo committed Sep 13, 2024
1 parent cbc7e06 commit 30aa153
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Promitor.Integrations.AzureMonitor.Extensions
public static class MetricResultExtension
{
// hacky to to get resource ID since it's not available directly through the SDK model
static string resourceIdPattern = @"^(subscriptions\/[^\/]+\/resourceGroups\/[^\/]+\/providers\/[^\/]+\/[^\/]+\/[^\/]+)";
static string resourceIdPattern = @"^([\/]?subscriptions\/[^\/]+\/resourceGroups\/[^\/]+\/providers\/[^\/]+\/[^\/]+\/[^\/]+)";
static Regex resourceIdRegex = new Regex(resourceIdPattern, RegexOptions.Compiled);

public static string ParseResourceIdFromResultId(this MetricResult metricResult)
Expand Down

0 comments on commit 30aa153

Please sign in to comment.