I think I see the problem now.
You need to delimit the string:
^[0-9]{1,5}(-[0-9]{3})?$
Add the "^" and the "$" and it should work for you.
M!ke
-----Original Message-----
From: Dawson, Michael [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 16, 2005 11:05 AM
To: CF-Talk
Subject: RE: stuck on regex
I just tested this with the RegexCoach and it worked.
"[0-9]{1,5}(-[0-9]{3})?"
12345-123 = Passes
12345-12 = Fails
12345 = Passes
Can you show some examples of what you consider good and bad?
Thanks
M!ke
-----Original Message-----
From: Rebecca Wells [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 16, 2005 10:51 AM
To: CF-Talk
Subject: RE: stuck on regex
The problem with this is that the [0-9]{1,5} part will accept "123456"
as true, which it technically is, but not what is wanted. It should only
allow 1 to 5 digits in the first part, but not more. That's the problem.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:209684
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54