diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2021-04-25 00:04:08 +0200 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2021-04-25 00:04:08 +0200 |
| commit | 48a69608f586183c08c41f9d1373a1a21b19e723 (patch) | |
| tree | b3175699c6c6e256ae23b346a95e0229e8e28703 /src/IOL.Helpers/StringHelpers.cs | |
| parent | 78e7eb9ea041384c59a9ce34c2a0de38185c9315 (diff) | |
| download | dotnet-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.cs | 4 |
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); } |
