I was wrong,
I forgot that the "^$" symbols are part of the expression, and thus I needed
an extra set of parens around everything but those two characters to get the
desired result.

Sorry for the trouble,
Eitan


-----Original Message-----
From: Eitan Katznelson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 16, 2002 2:17 PM
To: [EMAIL PROTECTED]
Subject: Correct me if im wrong


Hi,

I am using the reg-exp1.2 libraries and the following regular expression:
^([0-9]?[0-9]?[0-9](,[0-9]{3})+)|([0-9]+)$
to match user input for validation (Basically a positive number possibly
with commas).

when I run the input 123,12 it is accepted
when I run the input 123,123a it is accepted
when I run the input 123,12a it is rejected.

>From what I know about regular expressions none of the above should match,

Can anyone explain why this is happening??

Thanks,
Eitan



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to