I'm redoing my logging and one of the things I have to do is slice up the http_referer into useful parts. I can do the operation in multiple lines and multiple expressions, but I'd rather do it in one. Here's the code:
<CFSET referer="http://www.googlecom.com/search?hl=en&lr=&q=html+javax+parse+plain+text+example&btnG=Search"> <CFSET qReferer=REFindNoCase('^https?://([^/]+)/?(.+?([&?][pq]=([^&]+)).*?|.+)?$',referer&'&',1,1)> Positions 2=domain 3=referer string 5=search term This will basically try to find a search term first and if it totally fails (non-google/yahoo referer) it'll go to the alternate. This just doesn't 'feel' as tight as it could be. I wanted to do (.+?([&?][pq]=([^&]+))?.*?)?$ but it would never recognise the internal expression that would be the search. Is there something better I can do? Thanks Michael Dinowitz President: House of Fusion http://www.houseoffusion.com Publisher: Fusion Authority http://www.fusionauthority.com Adobe Community Expert ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/RegEx/message.cfm/messageid:965 Subscription: http://www.houseoffusion.com/groups/RegEx/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.21
