I have two thoughts.
1. The CompareValidato r can validate decimal numbers by setting its Operator
property to DataTypeCheck and Type=Decimal.
2. If you are assigning ValExpression programmaticall y using C#, the \
character is a special symbol. Always use two \ characters like this:
ValExpression = "(0|[1-9][0-9]*|[1-9][0-9]*\\.[0-9]*|0\\.[0-9]*)"
or use the @ symbol before the string to override the special characters:
ValExpression = @"(0|[1-9][0-9]*|[1-9][0-9]*\.[0-9]*|0\.[0-9]*)"
--- Peter Blum
www.PeterBlum.com
Email:
PL****@PeterBlu m.com
Creator of "Profession al Validation And More" at
http://www.peterblum.com/vam/home.aspx
"COHENMARVI N" <co*********@ho tmail.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
I am trying to use an regularexpressi on validator to match floating
numbers.
My expression doesn't work.
Here it is:
ValExpression = "(0|[1-9][0-9]*|[1-9][0-9]*\.[0-9]*|0\.[0-9]*)"
The \. is supposed to match the decimal point, but entering any
decimal point in a number doesn't work.
Any help is appreciated.
-- Marvin