Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #10241

Re: JavaScript Regex

From Dr J R Stockton <reply1202@merlyn.demon.co.uk>
Newsgroups comp.lang.javascript
Subject Re: JavaScript Regex
Date 2012-01-14 21:23 +0000
Organization Home
Message-ID <Vcoq+cHIJfEPFw0l@invalid.uk.co.demon.merlyn.invalid> (permalink)
References <8kosg7tha6n6epo47krtaulm9a269kvclo@4ax.com>

Show all headers | View raw


In comp.lang.javascript message <8kosg7tha6n6epo47krtaulm9a269kvclo@4ax.
com>, Wed, 11 Jan 2012 20:51:26, Gene Wirchenko <genew@ocis.net> posted:

>
>     I have not found quite the detail that I need for regexes.  If
>you have a URL to a good site, please post it.

<http://www.merlyn.demon.co.uk/js-valid.htm> lists some that I have
found.


>     I wish to parse a string to see if it is a valid fixed-decimal
>value.

Cannot actually be done.  "2012" may in truth be 2^8+1, to base 5.

And 014747 is really a bit pattern representation of a computer
instruction, highly amusing to those who can read PDP-11 code; it does
not mean decimal 6631.

For human input, you should generally allow leading and trailing
whitespace.  Then an optional sign.  Then at least one digit.  Then,
optionally, (a decimal point followed by at least one digit).  In any
particular application, you can probably also limit the number of
digits; for example, in currency, except for Government work, any more
than say nine digits before the decimal point probably means that the
cat has walked along the keyboard, or the euro has crashed, etc.


<http://www.merlyn.demon.co.uk/js-valid.htm#VNP> has what you need, if
you remove the exponent part.

-- 
 (c) John Stockton, nr London, UK.    ?@merlyn.demon.co.uk     Turnpike v6.05.
 Website  <http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
 PAS EXE etc. : <http://www.merlyn.demon.co.uk/programs/> - see in 00index.htm
 Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

JavaScript Regex Gene Wirchenko <genew@ocis.net> - 2012-01-11 20:51 -0800
  Re: JavaScript Regex Ross McKay <au.org.zeta.at.rosko@invalid.invalid> - 2012-01-12 17:07 +1100
    Re: JavaScript Regex Gene Wirchenko <genew@ocis.net> - 2012-01-12 12:13 -0800
      Re: JavaScript Regex "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-01-12 20:48 +0000
        Re: JavaScript Regex Dr J R Stockton <reply1202@merlyn.demon.co.uk> - 2012-01-14 20:41 +0000
          Re: JavaScript Regex "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-01-15 20:08 +0000
            Re: JavaScript Regex Dr J R Stockton <reply1203@merlyn.demon.co.uk> - 2012-01-16 21:55 +0000
  Re: JavaScript Regex Denis McMahon <denismfmcmahon@gmail.com> - 2012-01-12 15:05 +0000
    Re: JavaScript Regex Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-12 16:42 +0100
      Re: JavaScript Regex "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-01-12 16:09 +0000
    Re: JavaScript Regex "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-01-12 15:56 +0000
      Re: JavaScript Regex Dr J R Stockton <reply1202@merlyn.demon.co.uk> - 2012-01-14 20:44 +0000
      Re: JavaScript Regex Dr J R Stockton <reply1203@merlyn.demon.co.uk> - 2012-01-19 19:59 +0000
        Re: JavaScript Regex "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-01-20 09:19 +0000
          Re: JavaScript Regex Dr J R Stockton <reply1203@merlyn.demon.co.uk> - 2012-01-21 20:27 +0000
  Re: JavaScript Regex Dr J R Stockton <reply1202@merlyn.demon.co.uk> - 2012-01-14 21:23 +0000
    Re: JavaScript Regex Gene Wirchenko <genew@ocis.net> - 2012-01-15 21:10 -0800
      Re: JavaScript Regex Dr J R Stockton <reply1203@merlyn.demon.co.uk> - 2012-01-17 20:01 +0000
        Re: JavaScript Regex Scott Sauyet <scott.sauyet@gmail.com> - 2012-01-18 05:42 -0800
          Re: JavaScript Regex Dr J R Stockton <reply1203@merlyn.demon.co.uk> - 2012-01-19 20:11 +0000

csiph-web