using System.Text.RegularExpressions;
[InlineData("HMI.GEB.{0}","HMI.GEB.BY1")]
[InlineData("HMI.GEB.{0}","HMI.GEB.BY2")]
[InlineData("HMI.GEB.{0}","HMI.GEB.BY3")]
[InlineData("{0}.HMI.GEB.{1}","BY1.HMI.GEB.A")]
[InlineData("{0}.HMI.GEB.{1}","BY2.HMI.GEB.B")]
[InlineData("{0}.HMI.GEB.{1}","BY2.HMI.GEB.C")]
[InlineData("HMI.GEB","HMI.GEB.BY1")]
[InlineData("HMI.GEB","HMI.GEB.BY2")]
[InlineData("HMI.GEB","HMI.GEB.BY3")]
private void CheckShouldBeTrue(string pattern, string input)
Assert.True(Check(pattern,input));
private static bool Check(string pattern, string input){
pattern = pattern.Replace(".",@"\.");
var regexReplacer = new Regex(@"\{[0-9]+\}");
pattern = regexReplacer.Replace(pattern, ".+");
var regex = new Regex($"^{pattern}$");
return regex.IsMatch(input);