I am new to regular expressions. I am working on a code in C# where I need to calculate the number of variables in a mathematical function. I store those variables in a list. Currently I am using the following regular expression:
foreach (Match match in Regex.Matches(inputFunction, "[a-zA-Z]"))
{
variables.Add(match.Value);
}
The problem is that I don't want to add functions like Sin, Cos, Tan to the list. I only need to extract variables. For example if the user enters Sin(x), then I only need to add 'x' in variables list.