You're very welcome. Glad I could help.
On 6/13/07, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
Aaron Heimlich wrote:
> Try this:
>
> /^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/
Thanks, that works great.
--
Jörn Zaefferer
http://bassistance.de
--
Aaron Heimlich
Web Developer
[EMAIL PROTECTED
Aaron Heimlich wrote:
Try this:
/^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/
Thanks, that works great.
--
Jörn Zaefferer
http://bassistance.de
Try this:
/^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/
Tests:
/^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test("10");
true
/^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test("10.1");
true
/^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test("100.1");
true
/^(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test("1
What about something like this:
"100.12".match(/\d+(?:\.\d+)?/)
HTH,
Matt
On 6/12/07, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
Hi,
has anybody some regular expressions at hand that work in JS to match
decimal numbers, eg. 100, 100.4 or 100,120.124
Thanks for sharing.
--
Jörn Zaefferer
h
4 matches
Mail list logo