RE: Wildcard in statements
and 3) because to people who are familiar with regular expressions (and probably those not so familiar), the RE solution is MUCH more readable than the string manipulation code. IMHO, RegEx are the way to go for most solutions because you end up with cleaner code. Anything you can do with an RE can be done with 'normal' string manipulation, and the RE is probably the slower choice in a lot of situations. However, the easy-to-parse code and the ability to scale up and the problem gets more complex more than makes up for that extra 60 nanoseconds that the RE took to process. My $0.02 barneyb > -Original Message- > From: S. Isaac Dealey [mailto:[EMAIL PROTECTED] > Sent: Friday, February 21, 2003 6:12 PM > To: CF-Talk > Subject: Re: Wildcard in statements > > > There's no reason why it couldn't -- those of us familiar with regular > expressions answered the question with regex immediately for 2 reasons: 1) > because the way the question is phrased brings regex immediately > to mind for > us and 2) because to a man with a hammer, every problem looks like a nail. > :) > > > Question already answered, but I don't see why the > > wouldn't be > > possible with standard string functions. > > Just looking at your single line of pseudo-code, it looks > > like you want > > to know if the referer is a cfm template in a certain > > directory. > > > This bit of code would do that and would definitely > > execute faster > > than any regex... > > > > "http://www.mysite.com/folder/"; > > AND right(cgi.http_referer,4) EQ ".cfm"> > > > -- > > mailto:[EMAIL PROTECTED] > > Friday, February 21, 2003, 4:25:29 PM, you wrote: > > > ML> Can a wildcard character, such as a "*" be used > > successfully in the > > ML> following statement, or is there a better way: > > > ML> > "http://www.mysite.com/folder/*.cfm";> > > > ML> Thanks, Mark > > > ML> > > ~~ > > ~~~| > > Archives: > > http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 > > Subscription: http://www.houseoffusion.com/cf_lists/index. > > cfm?method=subscribe&forumid=4 > > FAQ: http://www.thenetprofits.co.uk/coldfusion/faq > > This list and all House of Fusion resources hosted by > > CFHosting.com. The place for dependable ColdFusion > > Hosting. > > > Unsubscribe: > http://www.houseoffusion.com/cf_lists/uns > > ubscribe.cfm?user=633.558.4 > > > > s. isaac dealey954-776-0046 > > new epoch http://www.turnkey.to > > lead architect, tapestry cms http://products.turnkey.to > > tapestry api is opensource http://www.turnkey.to/tapi > > certified advanced coldfusion 5 developer > http://www.macromedia.com/v1/handlers/index.cfm?ID=21816 > > ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Wildcard in statements
There's no reason why it couldn't -- those of us familiar with regular expressions answered the question with regex immediately for 2 reasons: 1) because the way the question is phrased brings regex immediately to mind for us and 2) because to a man with a hammer, every problem looks like a nail. :) > Question already answered, but I don't see why the > wouldn't be > possible with standard string functions. > Just looking at your single line of pseudo-code, it looks > like you want > to know if the referer is a cfm template in a certain > directory. > This bit of code would do that and would definitely > execute faster > than any regex... > "http://www.mysite.com/folder/"; > AND right(cgi.http_referer,4) EQ ".cfm"> > -- > mailto:[EMAIL PROTECTED] > Friday, February 21, 2003, 4:25:29 PM, you wrote: > ML> Can a wildcard character, such as a "*" be used > successfully in the > ML> following statement, or is there a better way: > ML> "http://www.mysite.com/folder/*.cfm";> > ML> Thanks, Mark > ML> > ~~ > ~~~| > Archives: > http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 > Subscription: http://www.houseoffusion.com/cf_lists/index. > cfm?method=subscribe&forumid=4 > FAQ: http://www.thenetprofits.co.uk/coldfusion/faq > This list and all House of Fusion resources hosted by > CFHosting.com. The place for dependable ColdFusion > Hosting. > Unsubscribe: http://www.houseoffusion.com/cf_lists/uns > ubscribe.cfm?user=633.558.4 s. isaac dealey954-776-0046 new epoch http://www.turnkey.to lead architect, tapestry cms http://products.turnkey.to tapestry api is opensource http://www.turnkey.to/tapi certified advanced coldfusion 5 developer http://www.macromedia.com/v1/handlers/index.cfm?ID=21816 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Wildcard in statements
Question already answered, but I don't see why the wouldn't be possible with standard string functions. Just looking at your single line of pseudo-code, it looks like you want to know if the referer is a cfm template in a certain directory. This bit of code would do that and would definitely execute faster than any regex... http://www.mysite.com/folder/"; AND right(cgi.http_referer,4) EQ ".cfm"> -- mailto:[EMAIL PROTECTED] Friday, February 21, 2003, 4:25:29 PM, you wrote: ML> Can a wildcard character, such as a "*" be used successfully in the ML> following statement, or is there a better way: ML> http://www.mysite.com/folder/*.cfm";> ML> Thanks, Mark ML> ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Wildcard in statements
See what I mean? That was much better advice than mine. :) ( even in spite of the corny slash-dot joke ) :) > Note that this regex lets > http://www.mysite.com/folder/subfolder/folder3/this.is.the > .file.cfm > and > http://www.mysite.com/folder/.cfm > through. > You may want to get even fancier and do something like > refind("http://www\.mysite\.com/folder/[^/.]+\.cfm";, > cgi.http_referrer) > Heehee. Slashdot! > And, as always, an open invitation to the Dojo, aka > CF-RegEx: > http://www.houseoffusion.com/cf_lists/index.cfm?method=thr > eads&forumid=21 > where the CF Regex ninjas will be happy to help defeat > your enemies .. er .. > problems. > -- Ben Doom > Programmer & General Lackey > Moonbow Software, Inc > : -Original Message- > : From: S. Isaac Dealey [mailto:[EMAIL PROTECTED] > : Sent: Friday, February 21, 2003 5:25 PM > : To: CF-Talk > : Subject: RE: Wildcard in statements > : > : > : > No, not with a direct string comparison. You must > make > : > your pilgrimage to > : > the temple of RegEx. > : > : > http://www\.mysite\.com/folder/.*\.cfm";, > : > cgi.http_referer) GT > : > 0> > : > : I'd add the beginning of string and end of string > markers just to be > : thorough. > : > : : REfind("^http://www\.mysite\.com/folder/.*\.cfm$",cgi.ht > tp_referer) GT > : 0> > : > : And if you find youself wanting this sort of thing > often, subscribe to the > : cf-regex list also @houseoffusion.com - low traffic, but > lots of great > : advice if you're ever stuck. > : > : s. isaac dealey954-776-0046 > : > : new epoch http://www.turnkey.to > : > : lead architect, tapestry cms > http://products.turnkey.to > : > : tapestry api is opensource > http://www.turnkey.to/tapi > : > : certified advanced coldfusion 5 developer > : http://www.macromedia.com/v1/handlers/index.cfm?ID=21816 > : > : > ~~ > ~~~| > Archives: > http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 > Subscription: http://www.houseoffusion.com/cf_lists/index. > cfm?method=subscribe&forumid=4 > FAQ: http://www.thenetprofits.co.uk/coldfusion/faq > Signup for the Fusion Authority news alert and keep up > with the latest news in ColdFusion and related topics. > http://www.fusionauthority.com/signup.cfm > Unsubscribe: http://www.houseoffusion.com/cf_lists/uns > ubscribe.cfm?user=633.558.4 s. isaac dealey954-776-0046 new epoch http://www.turnkey.to lead architect, tapestry cms http://products.turnkey.to tapestry api is opensource http://www.turnkey.to/tapi certified advanced coldfusion 5 developer http://www.macromedia.com/v1/handlers/index.cfm?ID=21816 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Wildcard in statements
Note that this regex lets http://www.mysite.com/folder/subfolder/folder3/this.is.the.file.cfm and http://www.mysite.com/folder/.cfm through. You may want to get even fancier and do something like refind("http://www\.mysite\.com/folder/[^/.]+\.cfm";, cgi.http_referrer) Heehee. Slashdot! And, as always, an open invitation to the Dojo, aka CF-RegEx: http://www.houseoffusion.com/cf_lists/index.cfm?method=threads&forumid=21 where the CF Regex ninjas will be happy to help defeat your enemies .. er .. problems. -- Ben Doom Programmer & General Lackey Moonbow Software, Inc : -Original Message- : From: S. Isaac Dealey [mailto:[EMAIL PROTECTED] : Sent: Friday, February 21, 2003 5:25 PM : To: CF-Talk : Subject: RE: Wildcard in statements : : : > No, not with a direct string comparison. You must make : > your pilgrimage to : > the temple of RegEx. : : > http://www\.mysite\.com/folder/.*\.cfm";, : > cgi.http_referer) GT : > 0> : : I'd add the beginning of string and end of string markers just to be : thorough. : : http://www\.mysite\.com/folder/.*\.cfm$",cgi.http_referer) GT : 0> : : And if you find youself wanting this sort of thing often, subscribe to the : cf-regex list also @houseoffusion.com - low traffic, but lots of great : advice if you're ever stuck. : : s. isaac dealey954-776-0046 : : new epoch http://www.turnkey.to : : lead architect, tapestry cms http://products.turnkey.to : : tapestry api is opensource http://www.turnkey.to/tapi : : certified advanced coldfusion 5 developer : http://www.macromedia.com/v1/handlers/index.cfm?ID=21816 : : ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Wildcard in statements
> No, not with a direct string comparison. You must make > your pilgrimage to > the temple of RegEx. > http://www\.mysite\.com/folder/.*\.cfm";, > cgi.http_referer) GT > 0> I'd add the beginning of string and end of string markers just to be thorough. http://www\.mysite\.com/folder/.*\.cfm$",cgi.http_referer) GT 0> And if you find youself wanting this sort of thing often, subscribe to the cf-regex list also @houseoffusion.com - low traffic, but lots of great advice if you're ever stuck. s. isaac dealey954-776-0046 new epoch http://www.turnkey.to lead architect, tapestry cms http://products.turnkey.to tapestry api is opensource http://www.turnkey.to/tapi certified advanced coldfusion 5 developer http://www.macromedia.com/v1/handlers/index.cfm?ID=21816 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Wildcard in statements
Thanks fellow pilgrim :o) Thanks, Mark -Original Message- From: Barney Boisvert [mailto:[EMAIL PROTECTED] Sent: Friday, February 21, 2003 4:30 PM To: CF-Talk Subject: RE: Wildcard in statements No, not with a direct string comparison. You must make your pilgrimage to the temple of RegEx. http://www\.mysite\.com/folder/.*\.cfm";, cgi.http_referer) GT 0> that should do it. barneyb > -Original Message- > From: Mark Leder [mailto:[EMAIL PROTECTED] > Sent: Friday, February 21, 2003 1:25 PM > To: CF-Talk > Subject: Wildcard in statements > > > Can a wildcard character, such as a "*" be used successfully in the > following statement, or is there a better way: > > http://www.mysite.com/folder/*.cfm";> > > Thanks, Mark > > ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Wildcard in statements
No, not with a direct string comparison. You must make your pilgrimage to the temple of RegEx. http://www\.mysite\.com/folder/.*\.cfm";, cgi.http_referer) GT 0> that should do it. barneyb > -Original Message- > From: Mark Leder [mailto:[EMAIL PROTECTED] > Sent: Friday, February 21, 2003 1:25 PM > To: CF-Talk > Subject: Wildcard in statements > > > Can a wildcard character, such as a "*" be used successfully in the > following statement, or is there a better way: > > http://www.mysite.com/folder/*.cfm";> > > Thanks, Mark > > ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4