[Ilugc] Reg exp help

  • From: suresh1876@xxxxxxxxx (Suresh Kumar)
  • Date: Sat Sep 8 14:23:14 2007



Beg to disagree. If I am not wrong, you are trying to validate a
currency and you have got an European client. In most parts of Europe,
DOT and COMMA are interchangeably used. Therefore, 1,000.00 is same as
1.000,00.


yes your are correct...

My Visa entry had an entry with 35,00 meaning 35 Euros.

With this background, the RegEx ^[0-9.,]*(\,)[0-9]{2} will also
validate ",,...28.12" which is incorrect.


yes.. i didn't chcek out that..

The following RegEx which I flicked out of Google searching for
"Regular Expression Currency Validation" and modifying it a little
gives me the following.

   ((\d{1,3}(\,\d{3})*(\.\d{2})?)|(\d{1,3}(\.\d{3})*(\,\d{2})?))


ok thanks.. for pointing out...

A couple of  problems though.  Just that it forces you to use the
thousand separator. It will not work for the Indian Number system
(comma after ten thousand).

HTH,

Regards,
Natarajan
_______________________________________________
To unsubscribe, email ilugc-request@xxxxxxxxxxxxx with
"unsubscribe <password> <address>"
in the subject or body of the message.
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc




-- 
  with regards

  http://www.discussweb.com
J Suresh Kumar
  99400 95614

Other related posts: