>- see footer for list info -<
Morning all,

I have not use Regex much so was looking for a bit of help.

I am taking the keywords out of google urls so I have always searched for q= .
Recently google added some other vars into the urls such as aq= and oq= which 
are breaking my code.
I want to strip these out but just need a bit of help finishing off the regex.

I thought these new variables in google held only 1 or 2 letter/number 
combinations (so the first eample works correctly with the regex i wrote) but 
it seems not. So the help i need is removing the variables either to the end of 
the variable combination (to the &) or to the end of the line (in the second 
url example) 

<cfset myref = 
"http://www.google.co.uk/search?sourceid=navclient&aq=1h&oq=&ie=UTF-8&rlz=1T4SUNA_enGB287GB291&q=my+google+keywords";>
<cfset myref = 
"http://www.google.co.uk/search?hl=en&q=my+keyword&meta=&aq=2&oq=word+p";>

<cfset result = REReplace(myref,"[a-z]q=[a-z0-9]?[a-z0-9]?&?","","all")>
<cfoutput>!#myref#!<br>!#result#!</cfoutput>

Thanks for any help.
Allan





_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- cfdeveloper Hosting provided by www.cfmxhosting.co.uk -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to