Will said that it would be OL1, OL2, in which case your example wouldn never
eval to true.
Will, something like this should work:
<cfset isOLCourse = REFindNoCase("OL[0-9]+",ListLast(getsection.section,
"-"))>
That looks for the letters OL followed by at least one number.
-----Original Message-----
From: Jim McAtee [mailto:[EMAIL PROTECTED]
Sent: Saturday, April 28, 2007 4:24 PM
To: CF-Talk
Subject: Re: How can I check this string a different way?
----- Original Message -----
From: "Will Tomlinson" <[EMAIL PROTECTED]>
To: "CF-Talk" <[email protected]>
Sent: Saturday, April 28, 2007 2:54 PM
Subject: How can I check this string a different way?
>I need a better way to evaluate a string here. Maybe a regex I guess?
>
> I have a hyphen-delimited list. The last item in the list needs to be
> flagged if it contains OL1, OL2, etc.
>
> Just if it contains the OL at all, I need to flag it as an online
> course.
>
> Here's what I'm using now, what's a better way to handle it?
>
> <cfif ListLast(getSection.section, "-") CONTAINS "OL">
> <cfset isOLCourse = true>
> </cfif>
<cfset isOLCourse = Left(ListLast(getSection.section, "-"), 2) is "OL">
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 by AdobeĀ®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7.
Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:276545
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4