so kind of a small problem, but i find the Regex expressions very hard to understand, i've been trying to look for a solution to my problem.
So, i have a class where i handle File types by their ending extensions as such:
public static bool IsPythonFile(string pattern)
{
if (Regex.IsMatch(pattern, ".py$", RegexOptions.IgnoreCase) ||
Regex.IsMatch(pattern, ".pyw$", RegexOptions.IgnoreCase) ||
Regex.IsMatch(pattern, ".py3$", RegexOptions.IgnoreCase) ||
Regex.IsMatch(pattern, ".pyi$", RegexOptions.IgnoreCase) ||
Regex.IsMatch(pattern, ".pyx$", RegexOptions.IgnoreCase) ||
Regex.IsMatch(pattern, ".py*$", RegexOptions.IgnoreCase) ||
Regex.IsMatch(pattern, ".pyw*$", RegexOptions.IgnoreCase) ||
Regex.IsMatch(pattern, ".py3*$", RegexOptions.IgnoreCase) ||
Regex.IsMatch(pattern, ".pyi*$", RegexOptions.IgnoreCase) ||
Regex.IsMatch(pattern, ".pyx*$", RegexOptions.IgnoreCase))
{
return true;
}
return false;
}
So the '*' (star sign) that i'm trying to implement comes from a Tabcontrol, when Text_Changed is triggered, signifying that the file has been modified.
I want to include '.py' or '.py*' at the ending of the end of the Tabpage text, and i would want to return true in this bool. Does anybody know the pattern? Thanks for the help.