Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="ISO-8859-1" Message-ID: <6913494.xuaST5U3oO@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Thu, 12 Jan 2012 16:42:38 +0100 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 7Bit Subject: Re: JavaScript Regex Newsgroups: comp.lang.javascript References: <8kosg7tha6n6epo47krtaulm9a269kvclo@4ax.com> <4f0ef6b7$0$30370$a8266bb1@newsreader.readnews.com> Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 27 NNTP-Posting-Date: 12 Jan 2012 16:42:41 CET NNTP-Posting-Host: 41c5e05a.newsspool4.arcor-online.net X-Trace: DXC=W^H^eVIgY8G74okIm;?DS@4IUK On Wed, 11 Jan 2012 20:51:26 -0800, Gene Wirchenko wrote: >> I wish to parse a string to see if it is a valid fixed-decimal >> value. > > /^[+-]?\d{1,}(\.\d*)?$/ > > http://www.sined.co.uk/tmp/regex.htm Wrong, see the ECMAScript Language Specification and, e. g., the JSON website. And what is *fixed* about this? !isNaN(+s) where `s' is a String value, suffices for strings representing floating- point values. If "fixed" is supposed to mean "a fixed number of decimals", a more elaborate expression needs to be used, but not this one (what about leading "." and scientific notation?). We have been over this. PointedEars -- var bugRiddenCrashPronePieceOfJunk = ( navigator.userAgent.indexOf('MSIE 5') != -1 && navigator.userAgent.indexOf('Mac') != -1 ) // Plone, register_function.js:16