Post Reply 
How to test a variable against another variable?
Aug. 21, 2008, 04:04 AM
Post: #1
How to test a variable against another variable?
I am trying to write a filter which will add links to Google cache results to allow continuing using the cache, just like this userscript does.

I intend to add links only for those urls which are from the same host, so I use below code to extract the host address and sotre it in a global variable for later use.

Code:
(This is Google's cache of <a[^>]+>http://\1/*</a>)\0$SET(currentHost=\1)

The next step is to match only the urls from the same host. I tried below code but it seems the $GET command can't be expanded in match field just like the help file stated:
Code:
<a*href=$AV($GET(currentHost)/\2)*</a>

Then I tried to capture the host part into a variable:
Code:
<a*href=$AV(\7/\2)*</a>

and tested it with the currentHost variable in the replace field but it doesn't work either.
Code:
$TST(\7=$GET(currentHost))$SET(......)

Any ideas?
Add Thank You Quote this message in a reply
Post Reply 


Messages In This Thread
How to test a variable against another variable? - whenever - Aug. 21, 2008 04:04 AM

Forum Jump: