Правильно написал регулярных выражений C#? почему только False
Тема: Использование регулярных выражений при разработке приложений на языке С#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace Laba_6{
class Program{
static void Main(string[] args){
Console.WriteLine("1KH-20MC");
string str = Console.ReadLine();
bool isValid = Analizator.IsValid(str);
Console.WriteLine(isValid);
Console.ReadKey();
}
}
static public class Analizator{
static Regex Letter;
static Regex Digits;
static Regex Name;
static Regex Param;
static Regex List_Param;
static public bool IsValid(string str){
Letter = new Regex("[a-z]");
Digits = new Regex("[0-9]");
Name = new Regex($"{Letter}" + "{" + $"{Letter}" + "}*");
Param = new Regex("{" + $"{Name}" + "=" + $"{Digits}" + "{" + $"{Digits}" + "}*" + "}" + "|" + "{" + $"{Name}" + "=" + "(" + $"{List_Param}" + ")" + "}");
List_Param = new Regex($"{Param}" + "{," + $"{Param}" + "}*");
Console.WriteLine(Letter);
Console.WriteLine(Digits);
Console.WriteLine(Name);
Console.WriteLine(Param);
Console.WriteLine(List_Param);
return List_Param.IsMatch(str);
}
}
}

