RegEx Bug??
Ok,
I wrote a Regular Expression that works fine in a RegularExpressionValidator problem is, the text boxes they are validating autopost back (unfortunately they have to to meet a functional requirement) so, even if the user inputs invalid data, there is no way (that i know of) to prevent the post back from occuring if the data is invalid!
So I wrote a function like so:
bool CheckMoney(string Value) {
System.Text.RegularExpressions.Regex ex = new System.Text.RegularExpressions.Regex("[0-9]+(\\.[0-9][0-9])?");
return ex.Match(Value).Success;
}
The regex should ONLY validate values of XXX.XX and, as i said, it works fine in a validator; but when I placed it in this function it will return true if the data is XXX.X, XXX.XX, XXX.XXX
Does anyone know why this is or, alternatively, how to prevent an autopost back from occuring if the validator rises?
--Stole this from a moderator
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click  on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
|