Regular Expression to match 0, 10, 20, 30, 40 or 50
The group you are posting to is a
Usenet group . Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
From:
Ben <micbal9... @gmail.com>
Date: Tue, 13 Oct 2009 14:12:47 -0700 (PDT)
Local: Tues, Oct 13 2009 5:12 pm
Subject: Regular Expression to match 0, 10, 20, 30, 40 or 50
Is it possible for a regular expression to validate whether a number
is equal to 0, 10, 20, 30, 40 or 50? If so, do you know the syntax?
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Accmailer <eugeny.satt... @gmail.com>
Date: Tue, 13 Oct 2009 23:55:52 -0700 (PDT)
Local: Wed, Oct 14 2009 2:55 am
Subject: Re: Regular Expression to match 0, 10, 20, 30, 40 or 50
simple!
[1-5]?0
that means one optional digit ranging from 1 to 5 followed by an
obligatory zero
while this would be the same (1|2|3|4|5)?0
as a precaution you may add
1)optional spaces...
\s*[1-5]?0\s*
and
2) start of input and end of input anchors
^\s*[1-5]?0\s*$
On October 14 , 02:12, Ben <micbal9... @gmail.com> wrote:
> Is it possible for a regular expression to validate whether a number
> is equal to 0, 10, 20, 30, 40 or 50? If so, do you know the syntax?
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Ben <micbal9... @gmail.com>
Date: Wed, 14 Oct 2009 06:23:52 -0700 (PDT)
Local: Wed, Oct 14 2009 9:23 am
Subject: Re: Regular Expression to match 0, 10, 20, 30, 40 or 50
Yep, very simple! Thanks very much!
On Oct 14, 2:55 am, Accmailer <eugeny.satt... @gmail.com> wrote:
> simple!
> [1-5]?0
> that means one optional digit ranging from 1 to 5 followed by an
> obligatory zero
> while this would be the same (1|2|3|4|5)?0
> as a precaution you may add
> 1)optional spaces...
> \s*[1-5]?0\s*
> and
> 2) start of input and end of input anchors
> ^\s*[1-5]?0\s*$
> On October 14 , 02:12, Ben <micbal9... @gmail.com> wrote:
> > Is it possible for a regular expression to validate whether a number
> > is equal to 0, 10, 20, 30, 40 or 50? If so, do you know the syntax?- Hide quoted text -
> - Show quoted text -
You must
Sign in before you can post messages.
You do not have the permission required to post.