RE: Simple Regular Expression?
Thanks Michael, that did the trick just fine. -Original Message- From: Dawson, Michael [mailto:[EMAIL PROTECTED] Sent: 09 September 2005 18:19 To: CF-Talk Subject: RE: Simple Regular Expression? I'm not sure if someone already answered this, but you should anchor the start and end of the strings. This pattern might do it, but it's not tested: "^(0|5|10|15|20|25|30|35|40|45|50)$" M!ke I am using the cfinput tag, validate="regular_expression" and I am totally confusing myself on trying to work out what the pattern should equal. Basically I want the user to only be allowed to enter one of the following values 0,5,10,15,20,25,30,35,40,45,50 They cannot enter anything else i.e. 55 I tried using the following pattern "(0|5|10|15|20|25|30|35|40|45|50)" but I do not think I an fully understanding this as part of the validation works but it also allows 55 to be entered, I think that is because the individual value 5 is allowed? Can anyone give me some pointers? ~| 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:217914 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
RE: Simple Regular Expression?
I'm not sure if someone already answered this, but you should anchor the start and end of the strings. This pattern might do it, but it's not tested: "^(0|5|10|15|20|25|30|35|40|45|50)$" M!ke I am using the cfinput tag, validate="regular_expression" and I am totally confusing myself on trying to work out what the pattern should equal. Basically I want the user to only be allowed to enter one of the following values 0,5,10,15,20,25,30,35,40,45,50 They cannot enter anything else i.e. 55 I tried using the following pattern "(0|5|10|15|20|25|30|35|40|45|50)" but I do not think I an fully understanding this as part of the validation works but it also allows 55 to be entered, I think that is because the individual value 5 is allowed? Can anyone give me some pointers? ~| 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:217801 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=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Simple Regular Expression?
Try anchoring it so that it has to match the whole string: ^([1-4][05])|(50)|(0)|(5)$ --Ben "not that Ben" Doom Andy McShane wrote: > Thanks for the reply Ben, your code makes it a bit more understandable as to > how to format an expression. The expression that you given me almost works > but does still allow 55 to be entered. > > -Original Message- > From: Ben Forta [mailto:[EMAIL PROTECTED] > Sent: 09 September 2005 16:17 > To: CF-Talk > Subject: RE: Simple Regular Expression? > > Oops, that would also allow 55. Try this, it allows digits 1-4 followed by a > 0 or a 5 (that takes care of 10-45), as well as 50 0 and 5: > > ([1-4][05])|(50)|(0)|(5) > > > > -Original Message- > From: Ben Forta [mailto:[EMAIL PROTECTED] > Sent: Friday, September 09, 2005 11:06 AM > To: CF-Talk > Subject: RE: Simple Regular Expression? > > In other words, you want 1 or 2 characters. If two characters you want 1-4 > followed by a 0 or a 5, and if one character you want 0 or 5 followed by a > space. > > So try: > > ([1-5][05])|(0 )|(5 ) > > > > -Original Message- > From: Andy Mcshane [mailto:[EMAIL PROTECTED] > Sent: Friday, September 09, 2005 10:56 AM > To: CF-Talk > Subject: Simple Regular Expression? > > I am using the cfinput tag, validate="regular_expression" and I am totally > confusing myself on trying to work out what the pattern should equal. > Basically I want the user to only be allowed to enter one of the following > values > > 0,5,10,15,20,25,30,35,40,45,50 > > They cannot enter anything else i.e. 55 > > I tried using the following pattern "(0|5|10|15|20|25|30|35|40|45|50)" but I > do not think I an fully understanding this as part of the validation works > but it also allows 55 to be entered, I think that is because the individual > value 5 is allowed? Can anyone give me some pointers? > > > > > > > > ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:217773 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
RE: Simple Regular Expression?
Thanks for the reply Ben, your code makes it a bit more understandable as to how to format an expression. The expression that you given me almost works but does still allow 55 to be entered. -Original Message- From: Ben Forta [mailto:[EMAIL PROTECTED] Sent: 09 September 2005 16:17 To: CF-Talk Subject: RE: Simple Regular Expression? Oops, that would also allow 55. Try this, it allows digits 1-4 followed by a 0 or a 5 (that takes care of 10-45), as well as 50 0 and 5: ([1-4][05])|(50)|(0)|(5) -Original Message- From: Ben Forta [mailto:[EMAIL PROTECTED] Sent: Friday, September 09, 2005 11:06 AM To: CF-Talk Subject: RE: Simple Regular Expression? In other words, you want 1 or 2 characters. If two characters you want 1-4 followed by a 0 or a 5, and if one character you want 0 or 5 followed by a space. So try: ([1-5][05])|(0 )|(5 ) -Original Message- From: Andy Mcshane [mailto:[EMAIL PROTECTED] Sent: Friday, September 09, 2005 10:56 AM To: CF-Talk Subject: Simple Regular Expression? I am using the cfinput tag, validate="regular_expression" and I am totally confusing myself on trying to work out what the pattern should equal. Basically I want the user to only be allowed to enter one of the following values 0,5,10,15,20,25,30,35,40,45,50 They cannot enter anything else i.e. 55 I tried using the following pattern "(0|5|10|15|20|25|30|35|40|45|50)" but I do not think I an fully understanding this as part of the validation works but it also allows 55 to be entered, I think that is because the individual value 5 is allowed? Can anyone give me some pointers? ~| 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:217767 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
RE: Simple Regular Expression?
Oops, that would also allow 55. Try this, it allows digits 1-4 followed by a 0 or a 5 (that takes care of 10-45), as well as 50 0 and 5: ([1-4][05])|(50)|(0)|(5) -Original Message- From: Ben Forta [mailto:[EMAIL PROTECTED] Sent: Friday, September 09, 2005 11:06 AM To: CF-Talk Subject: RE: Simple Regular Expression? In other words, you want 1 or 2 characters. If two characters you want 1-4 followed by a 0 or a 5, and if one character you want 0 or 5 followed by a space. So try: ([1-5][05])|(0 )|(5 ) -Original Message- From: Andy Mcshane [mailto:[EMAIL PROTECTED] Sent: Friday, September 09, 2005 10:56 AM To: CF-Talk Subject: Simple Regular Expression? I am using the cfinput tag, validate="regular_expression" and I am totally confusing myself on trying to work out what the pattern should equal. Basically I want the user to only be allowed to enter one of the following values 0,5,10,15,20,25,30,35,40,45,50 They cannot enter anything else i.e. 55 I tried using the following pattern "(0|5|10|15|20|25|30|35|40|45|50)" but I do not think I an fully understanding this as part of the validation works but it also allows 55 to be entered, I think that is because the individual value 5 is allowed? Can anyone give me some pointers? ~| 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:217765 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
RE: Simple Regular Expression?
> -Original Message- > From: Andy Mcshane [mailto:[EMAIL PROTECTED] > > Basically I want the user to only be > allowed to enter one of the following values > 0,5,10,15,20,25,30,35,40,45,50 > They cannot enter anything else i.e. 55 You might consider making them into a list and using another way to verify them? -- Damien McKenna - Web Developer - [EMAIL PROTECTED] The Limu Company - http://www.thelimucompany.com/ - 407-804-1014 #include ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:217763 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=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Simple Regular Expression?
In other words, you want 1 or 2 characters. If two characters you want 1-4 followed by a 0 or a 5, and if one character you want 0 or 5 followed by a space. So try: ([1-5][05])|(0 )|(5 ) -Original Message- From: Andy Mcshane [mailto:[EMAIL PROTECTED] Sent: Friday, September 09, 2005 10:56 AM To: CF-Talk Subject: Simple Regular Expression? I am using the cfinput tag, validate="regular_expression" and I am totally confusing myself on trying to work out what the pattern should equal. Basically I want the user to only be allowed to enter one of the following values 0,5,10,15,20,25,30,35,40,45,50 They cannot enter anything else i.e. 55 I tried using the following pattern "(0|5|10|15|20|25|30|35|40|45|50)" but I do not think I an fully understanding this as part of the validation works but it also allows 55 to be entered, I think that is because the individual value 5 is allowed? Can anyone give me some pointers? ~| 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:217762 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
Re: Simple Regular Expression Question ($ and ^)
Oh, that was difficult :-/ I just tried it, and it's working. I had tried it a long time ago, and it failed on me (must have been a faulty code), so I wrote it off... Thanks, Jamie On Mon, 14 Jan 2002 14:11:59 -0500, in cf-talk you wrote: >yes. $ and ^, respectively. > >christopher olive, cto, vp of web development >cresco technologies, inc >410.825.0383 >http://www.crescotech.com > > >-Original Message- >From: Jamie Jackson [mailto:[EMAIL PROTECTED]] >Sent: Monday, January 14, 2002 2:08 PM >To: CF-Talk >Subject: Simple Regular Expression Question ($ and ^) > > >Does CF's regex have an end/beginning of string anchor? > >(e.g. "$" and "^", respectively, in other languages) > >Thanks, > > __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Simple Regular Expression Question ($ and ^)
yes. $ and ^, respectively. christopher olive, cto, vp of web development cresco technologies, inc 410.825.0383 http://www.crescotech.com -Original Message- From: Jamie Jackson [mailto:[EMAIL PROTECTED]] Sent: Monday, January 14, 2002 2:08 PM To: CF-Talk Subject: Simple Regular Expression Question ($ and ^) Does CF's regex have an end/beginning of string anchor? (e.g. "$" and "^", respectively, in other languages) Thanks, __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists