By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,948 Members | 1,587 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,948 IT Pros & Developers. It's quick & easy.

regular expression

P: n/a
ragazzi come faccio a farmi accettare da una regular expression i caratteri
numeri (da 0 a 9) il segno + oltre che il .
Jul 20 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Redazione PianetaFantacalcio.it wrote on 12 nov 2003 in
comp.lang.javascript:
ragazzi come faccio a farmi accettare da una regular expression i
caratteri numeri (da 0 a 9) il segno + oltre che il .


/[\d\.+]+/
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #2

P: n/a
Redazione PianetaFantacalcio.it wrote:
ragazzi come faccio a farmi accettare da una regular expression i caratteri
numeri (da 0 a 9) il segno + oltre che il .


My Italian is hardly usable, so using the
Google Translation service I understand
that you are looking for

/\d+/

If not, please post examples of the strings
to be matched or write again in English.
PointedEars
Jul 20 '05 #3

P: n/a
me la scriveresti completa ........?
"Evertjan." <ex**************@interxnl.net> ha scritto nel messaggio
news:Xn********************@194.109.133.29...
Redazione PianetaFantacalcio.it wrote on 12 nov 2003 in
comp.lang.javascript:
ragazzi come faccio a farmi accettare da una regular expression i
caratteri numeri (da 0 a 9) il segno + oltre che il .


/[\d\.+]+/
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jul 20 '05 #4

P: n/a
Redazione PianetaFantacalcio.it wrote on 12 nov 2003 in
comp.lang.javascript:
"Evertjan." <ex**************@interxnl.net> ha scritto nel messaggio
news:Xn********************@194.109.133.29...
Redazione PianetaFantacalcio.it wrote on 12 nov 2003 in
comp.lang.javascript:
> ragazzi come faccio a farmi accettare da una regular expression i
> caratteri numeri (da 0 a 9) il segno + oltre che il .


/[\d\.+]+/

me la scriveresti completa ........?


<script>

function testing(s){
alert( /^[\d\.+]+$/.test(s) )
}

testing("+123.456") // true
testing("-123.456") // false
testing("+12A3.456") // false

</script>

Me scusi, non parlo Italiano, prego di respondere/follow-up in Inglesi ?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #5

P: n/a
JRS: In article <bo*************@ID-107532.news.uni-berlin.de>, seen in
news:comp.lang.javascript, Thomas 'PointedEars' Lahn
<Po*********@web.de> posted at Wed, 12 Nov 2003 23:32:30 :-
Redazione PianetaFantacalcio.it wrote:
ragazzi come faccio a farmi accettare da una regular expression i caratteri
numeri (da 0 a 9) il segno + oltre che il .


My Italian is hardly usable,
...


There is no need for you to answer questions that you do not properly
understand. In a group such as this, it is reasonable to expect that,
for each Western European language, there is at least one competent
regular here who knows it sufficiently well.

Chauvinism should be left to the French.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.
Jul 20 '05 #6

P: n/a
JRS: In article <Xn********************@194.109.133.29>, seen in
news:comp.lang.javascript, Evertjan. <ex**************@interxnl.net>
posted at Thu, 13 Nov 2003 09:42:05 :-
Redazione PianetaFantacalcio.it wrote on 12 nov 2003 in
comp.lang.javascript:

> ragazzi come faccio a farmi accettare da una regular expression i
> caratteri numeri (da 0 a 9) il segno + oltre che il .
alert( /^[\d\.+]+$/.test(s)


If it is for accepting a decimal number, the RegExp should be more like

/^[+-]?\d+(\.\d+)?$/
or /^[+-]?\d+(\.\d+)?(e[-+]?\d+)?$/i allows -3.4e+56

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.
Jul 20 '05 #7

P: n/a
Dr John Stockton wrote:
[...] Thomas 'PointedEars' Lahn [wrote]:
Redazione PianetaFantacalcio.it wrote:
ragazzi come faccio a farmi accettare da una regular expression i caratteri
numeri (da 0 a 9) il segno + oltre che il .


My Italian is hardly usable,
...


[...]
Chauvinism should be left to the French.


Do not conclude from your strange thinking about other nations to
that of other ones. All I wanted to do is trying to help. As said
before, this is no support forum, you do not always get the answer
you expected.
PointedEars
Jul 20 '05 #8

P: n/a
JRS: In article <bp*************@ID-107532.news.uni-berlin.de>, seen in
news:comp.lang.javascript, Thomas 'PointedEars' Lahn
<Po*********@web.de> posted at Fri, 14 Nov 2003 10:44:33 :-
Dr John Stockton wrote:
[...] Thomas 'PointedEars' Lahn [wrote]:
Redazione PianetaFantacalcio.it wrote:

ragazzi come faccio a farmi accettare da una regular expression icaratteri numeri (da 0 a 9) il segno + oltre che il .

My Italian is hardly usable,
...


[...]
Chauvinism should be left to the French.


Do not conclude from your strange thinking about other nations to
that of other ones. All I wanted to do is trying to help. As said
before, this is no support forum, you do not always get the answer
you expected.


When you do not understand an article, then, if it is likely that others
will understand it, just wait and read their replies.

There is no obligation on a questioner to write so that any particular
person can understand the question, and there is no obligation on a
reader to understand any particular question or answer.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME
Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
Web <URL:http://www.merlyn.demon.co.uk/news-use.htm> : about usage of News.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
Jul 20 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.