Post Reply 
How to test a variable against another variable?
Oct. 10, 2008, 01:18 PM
Post: #10
RE: How to test a variable against another variable?
That's better. I made some improvements based on your filter to cover the below situation:

cache:www.test.com&other=
No http:// between, no ended "/"

cache:www.test.com
currentHost is the last parameter

Code:
[Patterns]
Name = "Add cache links to Google cache results page {whenever,ln}081010"
Active = TRUE
URL = "$TYPE(htm)[^/]+/search\?*q=cache"
Bounds = "<a*</a>"
Limit = 256
Match = "$URL(*cache:(http://|)(\3)([/&]*|))$SET(currentHost=\3)"
        "(*href=$AV(http://$TST(currentHost)/\1|/\1)*)\2"
Replace = "\2<a href="http://www.google.com/search?hl=en&q=cache:http://$GET(currentHost)/\1"><img src="http://www.google.com/favicon.ico" style="border: none;" /></a>"
Add Thank You Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How to test a variable against another variable? - whenever - Oct. 10, 2008 01:18 PM

Forum Jump: