diff --git a/src/Ocelot/DependencyInjection/ConfigurationBuilderExtensions.cs b/src/Ocelot/DependencyInjection/ConfigurationBuilderExtensions.cs index 00cb0578..9e471475 100644 --- a/src/Ocelot/DependencyInjection/ConfigurationBuilderExtensions.cs +++ b/src/Ocelot/DependencyInjection/ConfigurationBuilderExtensions.cs @@ -30,12 +30,12 @@ namespace Ocelot.DependencyInjection public static IConfigurationBuilder AddOcelot(this IConfigurationBuilder builder) { - const string pattern = "(?i)ocelot(.*).json$"; + const string pattern = "(?i)ocelot.([a-zA-Z0-9]*).json"; var reg = new Regex(pattern); var files = Directory.GetFiles(".") - .Where(path => reg.IsMatch(path)).Where(x => x.Count(s => s == '.') == 3) + .Where(path => reg.IsMatch(path)) .ToList(); var fileConfiguration = new FileConfiguration();