The program looks at the list of directories, you need to weed out the folders that start with a number with a dot
Suppose there is a list:
1. OLD
2. MINI
MyProject1
MyProject2
MyProject3
But the regular expression for some reason does not work
Regex isCategory = new Regex(@"^[0-9]+\. [a-zA-Z]+", RegexOptions.IgnorePatternWhitespace); if(isCategory.IsMatch(item.Name)) { textBox.Text += item.Name + " - isCategory\r\n"; } else { textBox.Text += item.Name + "\r\n"; }
^[0-9]+\.triggered by me. - MonkIgnorePatternWhitespace- that’s the pattern doesn’t match. - Alexander Petrov