RE: Tighten up this logic.
The regex alone would work if you anchor it. '^[a-z]{1,2}[0-9]{5,11}$' Would somebody (or several somebody's) mind tighting up this logic. !--- Else If: the 1st field of the record is between 6 and 12 characters long, begins with 1 or 2 letters and ends with 5 to 11 digits, then the value is an Eye readable Codabar format. --- cfelseif len(trim(recAry[1])) GTE 6 AND len(trim(recAry[1])) LTE 12 AND refind([A-Z]{1,2}[0-9]{5,11},Ucase(trim(recAry[1]))) This [d4238616c] value should not have gotten through, but it did. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| 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:195442 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: Tighten up this logic.
That should be fine with just the addition of checking for the start and end of line. If you excuse me for a minute while I whip out my Regular Expressions in 10 minutes book... it might be this ^[A-Z]{1,2}[0-9]{5,11}$ Does that work? Ade -Original Message- From: Ian Skinner [mailto:[EMAIL PROTECTED] Sent: 18 February 2005 18:55 To: CF-Talk Subject: Tighten up this logic. Would somebody (or several somebody's) mind tighting up this logic. !--- Else If: the 1st field of the record is between 6 and 12 characters long, begins with 1 or 2 letters and ends with 5 to 11 digits, then the value is an Eye readable Codabar format. --- cfelseif len(trim(recAry[1])) GTE 6 AND len(trim(recAry[1])) LTE 12 AND refind([A-Z]{1,2}[0-9]{5,11},Ucase(trim(recAry[1]))) This [d4238616c] value should not have gotten through, but it did. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.8 - Release Date: 14/02/2005 ~| 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:195445 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: Tighten up this logic.
Michael Dinowitz wrote: The regex alone would work if you anchor it. '^[a-z]{1,2}[0-9]{5,11}$' That would allow AA01234567890, which is 13 characters long. Jochem ~| 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:195446 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: Tighten up this logic.
Ian Skinner wrote: Would somebody (or several somebody's) mind tighting up this logic. !--- Else If: the 1st field of the record is between 6 and 12 characters long, begins with 1 or 2 letters and ends with 5 to 11 digits, then the value is an Eye readable Codabar format. --- cfelseif len(trim(recAry[1])) GTE 6 AND len(trim(recAry[1])) LTE 12 AND refind([A-Z]{1,2}[0-9]{5,11},Ucase(trim(recAry[1]))) cfelseif len(trim(recAry[1])) LTE 12 AND refind(^[A-Z]{1,2}[0-9]{5,11}$,Ucase(trim(recAry[1]))) Jochem ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:195443 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: Tighten up this logic.
How about this: cfelseif reFindNoCase('^[a-z]{1,2}[0-9]{5,11}$',recAry[1]) Spike Ian Skinner wrote: Would somebody (or several somebody's) mind tighting up this logic. !--- Else If: the 1st field of the record is between 6 and 12 characters long, begins with 1 or 2 letters and ends with 5 to 11 digits, then the value is an Eye readable Codabar format. --- cfelseif len(trim(recAry[1])) GTE 6 AND len(trim(recAry[1])) LTE 12 AND refind([A-Z]{1,2}[0-9]{5,11},Ucase(trim(recAry[1]))) This [d4238616c] value should not have gotten through, but it did. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:195444 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: Tighten up this logic.
Thanks for everybody's help. I figured it was something along the lines of anchoring as you all explained, but I didn't even know enough about regex to know it was called anchoring to look up how I could do it simply. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA C code. C code run. Run code run. Please! - Cynthia Dunning -Original Message- From: Jochem van Dieten [mailto:[EMAIL PROTECTED] Sent: Friday, February 18, 2005 11:05 AM To: CF-Talk Subject: Re: Tighten up this logic. Ian Skinner wrote: Would somebody (or several somebody's) mind tighting up this logic. !--- Else If: the 1st field of the record is between 6 and 12 characters long, begins with 1 or 2 letters and ends with 5 to 11 digits, then the value is an Eye readable Codabar format. --- cfelseif len(trim(recAry[1])) GTE 6 AND len(trim(recAry[1])) LTE 12 AND refind([A-Z]{1,2}[0-9]{5,11},Ucase(trim(recAry[1]))) cfelseif len(trim(recAry[1])) LTE 12 AND refind(^[A-Z]{1,2}[0-9]{5,11}$,Ucase(trim(recAry[1]))) Jochem ~| 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:195455 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