From e13239077aa96ce74867f028fd35e69dd282a96e Mon Sep 17 00:00:00 2001 From: Andy Pack Date: Sun, 29 Sep 2024 10:12:36 +0100 Subject: [PATCH] fixing regex --- Overflow/SouthernWater/SouthernWaterApi.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Overflow/SouthernWater/SouthernWaterApi.cs b/Overflow/SouthernWater/SouthernWaterApi.cs index 5d62128..8436bae 100644 --- a/Overflow/SouthernWater/SouthernWaterApi.cs +++ b/Overflow/SouthernWater/SouthernWaterApi.cs @@ -22,7 +22,7 @@ public partial class SouthernWaterApi _logger = logger; } - [GeneratedRegex(@".*const APIURL = '(?.*)'.*\n.*const APIGWKEY = '(?.*)'.*", RegexOptions.IgnoreCase)] + [GeneratedRegex(@".APIURL=""(?.*)"".*APIGWKEY=""(?.*?)"".*", RegexOptions.IgnoreCase)] private static partial Regex ApiUrlAndKey(); public async Task LoadApiUrl() @@ -67,11 +67,13 @@ public partial class SouthernWaterApi if (apiUrlFound) { baseUrl = apiUrl.Value; + _logger.LogInformation("API url found [{APIUrl}]", apiUrl); } if (apiKeyFound) { this.apiKey = apiKey.Value; + _logger.LogInformation("API key found [{APIKey}]", apiKey); } } catch (HttpRequestException e)