Regular expression in asp.net
-
Hi I need a regular expression for 1.00E+05.. I am using [-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?|^$ but it is not working..its accepts any character after the numeric value i.e. its returns true for 100abcd, however this is wrong. Only a single e or E should accept.
Pankaj
-
Hi I need a regular expression for 1.00E+05.. I am using [-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?|^$ but it is not working..its accepts any character after the numeric value i.e. its returns true for 100abcd, however this is wrong. Only a single e or E should accept.
Pankaj
Try: [-+]?([0-9]+)\.([0-9])+[eE][\+-]?[0-9][0-9]? I strongly recommend you get a copy of Expresso[^] - it makes working with regexes so much easier... [edit]eh up - one o me brackets vanished...it's back now![/edit]
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"
-
Try: [-+]?([0-9]+)\.([0-9])+[eE][\+-]?[0-9][0-9]? I strongly recommend you get a copy of Expresso[^] - it makes working with regexes so much easier... [edit]eh up - one o me brackets vanished...it's back now![/edit]
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"
Thanks for your help..but I need to allow blank also, means either there should be blank or valid value, but this expression does not allow blank, that's why I added |^$ at the end of the expression. But still not working properly. :((
Pankaj