diff options
Diffstat (limited to 'src')
| -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); } |
