Post Reply 
How to test a variable against another variable?
Oct. 08, 2008, 09:56 PM
Post: #5
RE: How to test a variable against another variable?
whenever Wrote: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>
...snip...
Any ideas?

Here's a test filter that does what you want, I think.
Code:
[Patterns]
Name = "New HTML filter"
Active = FALSE
Limit = 256
Match = "$SET(foo=http://www.foobar.com)"
        "(<a*href=$AV($TST(foo)/\2)*</a>)\3"
Replace = "\3"

In the log window, these will match:
Code:
<a href="http://www.foobar.com/foo_for_all/" >foo for all </a>
<a href="http://www.foobar.com/foo_for_one/" >foo for one </a>

This one does not:
Code:
<a href="http://www.nofoo.com/foo_for_all/" >foo for all </a>

HTH
z12
Add Thank You Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How to test a variable against another variable? - z12 - Oct. 08, 2008 09:56 PM

Forum Jump: