summaryrefslogtreecommitdiffstats
path: root/src/IOL.Helpers/StringHelpers.cs
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2021-04-25 00:04:08 +0200
committerivarlovlie <git@ivarlovlie.no>2021-04-25 00:04:08 +0200
commit48a69608f586183c08c41f9d1373a1a21b19e723 (patch)
treeb3175699c6c6e256ae23b346a95e0229e8e28703 /src/IOL.Helpers/StringHelpers.cs
parent78e7eb9ea041384c59a9ce34c2a0de38185c9315 (diff)
downloaddotnet-helpers-48a69608f586183c08c41f9d1373a1a21b19e723.tar.xz
dotnet-helpers-48a69608f586183c08c41f9d1373a1a21b19e723.zip
Fix UnicornFormatWithEnvironment
Diffstat (limited to 'src/IOL.Helpers/StringHelpers.cs')
-rw-r--r--src/IOL.Helpers/StringHelpers.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/IOL.Helpers/StringHelpers.cs b/src/IOL.Helpers/StringHelpers.cs
index 3f80d6e..0c25184 100644
--- a/src/IOL.Helpers/StringHelpers.cs
+++ b/src/IOL.Helpers/StringHelpers.cs
@@ -29,9 +29,9 @@ namespace IOL.Helpers
public static string UnicornFormatWithEnvironment(this string input, IConfiguration configuration) {
if (string.IsNullOrWhiteSpace(input)) return default;
- var matchList = Regex.Matches(input, "");
+ var matchList = Regex.Matches(input, "{[a-z|_]*}", RegexOptions.IgnoreCase);
foreach (var key in matchList.Select(match => match.Value)) {
- var value = configuration.GetValue<string>(key);
+ var value = configuration.GetValue<string>(key.Substring(1, key.Length - 2));
if (string.IsNullOrWhiteSpace(value)) continue;
input = input.Replace(key, value);
}