Consider the below
Case 1: SDN#(X,)
Case 2: SDN#(X,12)
Case 3: SDN#(34,12)
Case 4: CORR#(X,,)
Case 5: CORR#(X,12,45)
Case 6: CFH#(X,AVG)
These all are some kind of custom functions.
How can I build a regular expression that will identity that the given text satisfies the function requirement
The generalised structure is as <FUNCTION NAME>#(arg1,[arg2],[agr3]....)
e.g. given CORR, or CORR#() it is not a funciton.
Because every function must have atleast one argument(which will be alphanumeric).
My approach so far is
Regex r = new Regex(@"([A-Z]+)[#]([A-Z a-z 0-9]+),([A-Z a-z 0-9]+),([A-Z a-z 0-9]+)");
Match m = r.Match(txtFunction.Text);
if (m.Success) MessageBox.Show("OK");
else MessageBox.Show("Not OK");
But it is not working
I am using C#3.0
Thanks