Thanks Tom. I tend to use regular expressions as a last resort, which is probably a mistake since they're often faster. In a small example like this the speed gained would probably be negligible. They are very powerful even if hard to read. It's just my lack of willingness to sit down and study regular expressions that lead me to my solution. :)

Chris

Tom Woestman wrote:

Chris,

 

I thought your solution was elegant and easier to read than mine.  I guess my days of creating my first web site in perl are still sticking with me as I seemed to use regular expressions all over the place back then…  Now I would like to see a one liner solution to this one J

 

Tom

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Christopher Jordan
Sent: Wednesday, September 13, 2006 2:55 PM
To: Dallas/Fort Worth ColdFusion User Group Mailing List
Subject: Re: [DFW CFUG] Brain Teaser

 

whoops... is using CGI.QueryString cheating? If so, then my solution breaks the rules.... it's also not a one liner. :(

Tom Woestman wrote:

How about this:
 
<cfset reResults - reFind("numPageID=([0-9]+)", CGI.HTTP_REFERER, 1,
true)>
<cfset theNum = mid(CGI.HTTP_REFERER, reResults.pos[2],
reResults.len[2])>
 
Tom
 
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Joe Kelly
Sent: Wednesday, September 13, 2006 2:35 PM
To: Dallas/Fort Worth ColdFusion User Group Mailing List
Subject: [DFW CFUG] Brain Teaser
 
I want to see if someone can come up with a more elegant solution to
this problem.
 
Given:
CGI.HTTP_REFERER will always have a URL variable, "numPageID=xxx"
which is numeric and could be any size number.
The HTTP_REFERER may or may not have other URL variables in any order,
which could be alphanumeric or numeric
The current template needs to pull the value of the "numPageID" URL
variable out of the CGI.HTTP_REFERER
 
I'll show my solution in another post so as not to spoil anyone's view
on this problem, not saying that mine is best, of course!
 
Thanks,
Joe Kelly
 
_______________________________________________
Reply to DFWCFUG: 
  [email protected]
Subscribe/Unsubscribe: 
  http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives: 
    http://www.mail-archive.com/list%40list.dfwcfug.org/             
  http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors: 
  www.HostMySite.com 
  www.teksystems.com/
 
 
_______________________________________________
Reply to DFWCFUG: 
  [email protected]
Subscribe/Unsubscribe: 
  http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives: 
    http://www.mail-archive.com/list%40list.dfwcfug.org/             
  http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors: 
  www.HostMySite.com 
  www.teksystems.com/
 
 
  

_______________________________________________ Reply to DFWCFUG: [email protected] Subscribe/Unsubscribe: http://lists1.safesecureweb.com/mailman/listinfo/list List Archives: http://www.mail-archive.com/list%40list.dfwcfug.org/ http://www.mail-archive.com/list%40dfwcfug.org/ DFWCFUG Sponsors: www.HostMySite.com www.teksystems.com/


_______________________________________________
Reply to DFWCFUG: 
  [email protected]
Subscribe/Unsubscribe: 
  http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives: 
    http://www.mail-archive.com/list%40list.dfwcfug.org/             
  http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors: 
  www.HostMySite.com 
  www.teksystems.com/

Reply via email to