V
venugopal.sjce
Hi Friends,
I'm constructing a regular expression for validating an expression
which looks as any of the following forms:
1. [GrandTotal]=4*[TotalCharges]+[currentCharges]+2
OR
2. [TotalCharges]=Sum([CurrentCharges])*6
Some of the samples I have constructed below:
StringEx RegEx
[alphaNumeric] ---> ^\[[a-zA-Z]+[0-9]*\]$
[TotalCharges]+2 ---> ^\[[a-zA-Z]+[0-9]*\](\
+[0-9]*)*$
[TotalCharges]/22+5/6*8---> ^\[[a-zA-Z]+[0-9]*\]([\+\-\*\/][0-9]*)*$
[TotalCharges]/22+5/6*8+[currChrgs] ---->^\[[a-zA-Z]+[0-9]*\]([\+\-\*
\/][0-9]*)*([\+\-\*\/]\[[a-zA-Z]+[0-9]*\])*$
2*[TotalCharges]/22+5/6*8+[currChrgs] ----->^([0-9]*[\+\-\*\/])*\[[a-
zA-Z]+[0-9]*\]([\+\-\*\/][0-9]*)*([\+\-\*\/]\[[a-zA-Z]+[0-9]*\])*$
Pls help me... I'm badly in need of this in my project.
Thanks in advance...
Venu.
I'm constructing a regular expression for validating an expression
which looks as any of the following forms:
1. [GrandTotal]=4*[TotalCharges]+[currentCharges]+2
OR
2. [TotalCharges]=Sum([CurrentCharges])*6
Some of the samples I have constructed below:
StringEx RegEx
[alphaNumeric] ---> ^\[[a-zA-Z]+[0-9]*\]$
[TotalCharges]+2 ---> ^\[[a-zA-Z]+[0-9]*\](\
+[0-9]*)*$
[TotalCharges]/22+5/6*8---> ^\[[a-zA-Z]+[0-9]*\]([\+\-\*\/][0-9]*)*$
[TotalCharges]/22+5/6*8+[currChrgs] ---->^\[[a-zA-Z]+[0-9]*\]([\+\-\*
\/][0-9]*)*([\+\-\*\/]\[[a-zA-Z]+[0-9]*\])*$
2*[TotalCharges]/22+5/6*8+[currChrgs] ----->^([0-9]*[\+\-\*\/])*\[[a-
zA-Z]+[0-9]*\]([\+\-\*\/][0-9]*)*([\+\-\*\/]\[[a-zA-Z]+[0-9]*\])*$
Pls help me... I'm badly in need of this in my project.
Thanks in advance...
Venu.