JRS: In article <11*********************@g44g2000cwa.googlegroups. com>,
dated Sat, 13 Aug 2005 14:46:47, seen in news:comp.lang.javascript, Nick
<ni*******@hotmail.com> posted :
How can I check if a number exists by itself in this string by using
the RegExp object?
You need to define "number" and "by itself" unambiguously; only then can
a suitable RegExp be chosen.
Does "number" mean digit, decimal digit, one or more of those, with a
sign, with a decimal point, with an exponent part, octal or hexadecimal
number, within the range of type Number ??
Does "by itself" mean that there must be no other characters in the
string, no other "printing" characters?; or is it only the characters on
each side that matter?; what if it is at the beginning or end of the
string?
If it is the characters on each side that matter, which are allowed?
The numbers of the properties to the east of to mine are of the form 97X
& 97Y.
Is the 5 in a5a "by itself"? Is punctuation allowed, but not letters?
How about .5 - is that a half or a five?
<URL:http://www.merlyn.demon.co.uk/js-valid.htm>.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.