Regular expression that rejects empty string.
-
Hi, I have a regular expression for entering decimal values with exactly 2 digits after the comma. [0-9]{1,4},[0-9]{2} "1.34" -> ok "9765.51" -> ok "67453.56" -> nok "-7.45" -> nok "67.1" -> nok "" -> ok I would like that to be nok. My problem is that even when I enter nothing (empty string) it passes the test. How can I prevent this from happening. tia
-
Hi, I have a regular expression for entering decimal values with exactly 2 digits after the comma. [0-9]{1,4},[0-9]{2} "1.34" -> ok "9765.51" -> ok "67453.56" -> nok "-7.45" -> nok "67.1" -> nok "" -> ok I would like that to be nok. My problem is that even when I enter nothing (empty string) it passes the test. How can I prevent this from happening. tia
Check this page http://regexlib.com/\[[^](http://regexlib.com/ "New Window")]"> One thing also you can do before passing it to regex check whether it is empty string and implement accordingly
Cheers!! Brij