Groups
Groups
Sign in
Groups
Groups
Regex
Conversations
Labels
About
Send feedback
Help
Regular Expression to match 0, 10, 20, 30, 40 or 50
4 views
Skip to first unread message
Ben
unread,
Oct 13, 2009, 5:12:47 PM
10/13/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Regex
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?
Accmailer
unread,
Oct 14, 2009, 2:55:52 AM
10/14/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Regex
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*$
Ben
unread,
Oct 14, 2009, 9:23:52 AM
10/14/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Regex
Yep, very simple! Thanks very much!
> > is equal to 0, 10, 20, 30, 40 or 50? If so, do you know the syntax?- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages