Regular expression

D

davranfor

Hello

I need a regular expression that validate a list of numbers separated
by "-" , numbers can not be greater than 999


Valid examples
0
12-455-01
1-9
125-32-155-45-45

Invalid examples
-1
45-
1-45665456-4
12-45-
-

Thanks ;)
 
E

Evertjan.

wrote on 17 okt 2007 in comp.lang.javascript:
I need a regular expression that validate a list of numbers separated
by "-" , numbers can not be greater than 999


Valid examples
0
12-455-01
1-9
125-32-155-45-45

Invalid examples
-1
45-
1-45665456-4
12-45-
-

Interesting needs some people have.

Do you have a question?

What did you try yourself?
 
J

Janwillem Borleffs

I need a regular expression that validate a list of numbers separated
by "-" , numbers can not be greater than 999

alert(/^\d{1,3}(-\d{1,3})*$/.test('125-32-155-45-45'));


JW
 
D

davranfor

wrote on 17 okt 2007 in comp.lang.javascript:






Interesting needs some people have.

Do you have a question?

What did you try yourself?

too difficult for you?
 
E

Evertjan.

wrote on 18 okt 2007 in comp.lang.javascript:

[please do not quote signatures on usenet]]
too difficult for you?

I for one prefer to help you learn and understand than to offer unasked
"needed" scripts.
 
D

davranfor

wrote on 18 okt 2007 in comp.lang.javascript:



[please do not quote signatures on usenet]]
too difficult for you?

I for one prefer to help you learn and understand than to offer unasked
"needed" scripts.

and where is your help?
too difficult for you !!!
 
E

Evertjan.

wrote on 18 okt 2007 in comp.lang.javascript:
wrote on 18 okt 2007 in comp.lang.javascript: [....]
Interesting needs some people have.
Do you have a question?
What did you try yourself?

[please do not quote signatures on usenet]]
too difficult for you?

I for one prefer to help you learn and understand than to offer
unasked "needed" scripts.

[again signature removed]
and where is your help?
too difficult for you !!!

Do you read what you are responding on?
Usenet is not a payed helpdesk.

And you haven't even asked a question yet,
but these above: "too difficult for you?" and "and where is your help?"

So again:
1 Ask what you want. Possibly you do not know what you need.
2 Include what you have done sofar in coding.
3 do not include signatures, read the Usenet Netiquette.
 
D

davranfor

wrote on 18 okt 2007 in comp.lang.javascript:




wrote on 18 okt 2007 in comp.lang.javascript: [....]
Interesting needs some people have.
Do you have a question?
What did you try yourself?
[please do not quote signatures on usenet]]
too difficult for you?
I for one prefer to help you learn and understand than to offer
unasked "needed" scripts.

[again signature removed]
and where is your help?
too difficult for you !!!

Do you read what you are responding on?
Usenet is not a payed helpdesk.

And you haven't even asked a question yet,
but these above: "too difficult for you?" and "and where is your help?"

So again:
1 Ask what you want. Possibly you do not know what you need.
2 Include what you have done sofar in coding.
3 do not include signatures, read the Usenet Netiquette.

Yes, thats right, I ask what I want... if you dont know the answer
forgive me... is too difficult for you!!!
 
E

Evertjan.

wrote on 18 okt 2007 in comp.lang.javascript:
wrote on 18 okt 2007 in comp.lang.javascript:
On 18 oct, 12:08, "Evertjan." <[email protected]>
wrote:
wrote on 18 okt 2007 in comp.lang.javascript: [....]
Interesting needs some people have.
Do you have a question?
What did you try yourself?
[please do not quote signatures on usenet]]
too difficult for you?
I for one prefer to help you learn and understand than to offer
unasked "needed" scripts.

[again signature removed]
and where is your help?
too difficult for you !!!

Do you read what you are responding on?
Usenet is not a payed helpdesk.

And you haven't even asked a question yet,
but these above: "too difficult for you?" and "and where is your
help?"

So again:
1 Ask what you want. Possibly you do not know what you need.
2 Include what you have done sofar in coding.
3 do not include signatures, read the Usenet Netiquette.

[third time]
Yes, thats right, I ask what I want...

No, you did not pose a question yet, only posted a need.
if you dont know the answer
forgive me... is too difficult for you!!!

What is there to forgive?
Or is it too difficult for me to forgive you?
Do you think you did wrong and need forgiving?

"too difficult for you!!!",
are you still in kindergarten,
where one uses arguments like that?
 
D

davranfor

wrote on 18 okt 2007 in comp.lang.javascript:


wrote on 18 okt 2007 in comp.lang.javascript:
On 18 oct, 12:08, "Evertjan." <[email protected]>
wrote:
wrote on 18 okt 2007 in comp.lang.javascript:
[....]
Interesting needs some people have.
Do you have a question?
What did you try yourself?
[please do not quote signatures on usenet]]
too difficult for you?
I for one prefer to help you learn and understand than to offer
unasked "needed" scripts.
[again signature removed]
and where is your help?
too difficult for you !!!
Do you read what you are responding on?
Usenet is not a payed helpdesk.
And you haven't even asked a question yet,
but these above: "too difficult for you?" and "and where is your
help?"
So again:
1 Ask what you want. Possibly you do not know what you need.
2 Include what you have done sofar in coding.
3 do not include signatures, read the Usenet Netiquette.

[third time]
Yes, thats right, I ask what I want...

No, you did not pose a question yet, only posted a need.
if you dont know the answer
forgive me... is too difficult for you!!!

What is there to forgive?
Or is it too difficult for me to forgive you?
Do you think you did wrong and need forgiving?

"too difficult for you!!!",
are you still in kindergarten,
where one uses arguments like that?

Mira mozo , no me gusta pelear en desigualdad de condiciones, lo digo
porque mi idioma nativo es el español y no puedo cantarte las 40 como
yo quisiera, asi que buscate la vida para traducir esto, si lo
entiendes bien y si no que te den dos duros:

1- En un grupo de noticias una necesidad es una pregunta.
2- No juzgues de antemano lo que otro pueda haber estado investigando
por su cuenta, quizás mucha gente pregunte para que le resuelvan, pero
personalmente llevo varios dias quemandome las cejas con las
expresiones regulares, lo tenía resuelto pero quería cerciorarme de
que era correcto antes de ponerlo en producción, el amigo Rik se ha
tomado la molestia de explicar punto por punto la pregunta formulada y
tú has venido a atacar sin aportar comentario alguno, entiendo que si
hubiera entrado a insultar o a crear un flame o a spamear me pusieras
a caldo, pero por preguntar algo acerca de programación en un grupo de
programación ...
3. Me estás volviendo loco con la puta signature, estoy posteando
desde los grupos de google y no estoy acotando ni añadiendo ninguna
firma, no pienso volverme jilipoyas tratando de entender lo que dices,
las quejas a google.
4. Un saludo desde Palma de Mallorca, mal llueva todo el año en tu
tierra.

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,150
Messages
2,570,853
Members
47,394
Latest member
Olekdev

Latest Threads

Top