Post Reply 
Problem with "\h"
Jul. 30, 2004, 10:57 AM
Post: #12
 
ProxRocks Wrote:Is that going to be included in the next release?
Yep Smile!

z12 Wrote:It seems that no matter how you cut it, "\h" can't be used reliably with country codes.
\h has two functions: to store the hostname and to serve as a domain test.
The first function always works, eg: Match = "*" Replace = "\h" .
The second function fails on 2-level TLDs, eg: Match = "://(^\h)" .

If you store the hostname like "$SET(host=\h)", you are using the first function.
If you are storing the real domain in "dom", the intention is to replace the second \h function with eg:
Match = "://(^([^/]++.|)$TST(dom))"

So here is a test filter, reference site is http://bbc.co.uk/. Result is displayed upper left:
Code:
[Patterns]
Name = "Domain Test"
Active = TRUE
Multi = TRUE
Limit = 1
Match = "(?)\1$STOP()"
"$SET(dref=http://bbc.co.uk/)"
"$SET(dhost=\h)"
""
"$TST(dhost="
"([0-9.]+)\9(^?)"
"|"
"(|*.)"
"("
"[^.]+."
"((com|net|edu|gov|org|mil|info|??).??|[^.]+)"
")\9(^?)"
")"
"$SET(dom=\9)"
""
"($TST(dref=*://([^/]++.|)$TST(dom)*)$SET(2=onsite)|$SET(2=offsite))"
Replace = "<div>\2: \9</div\r\n\1$SET(dref=)$SET(dhost=)"


Siamesecat: For most sites outside the US the country code is the top level domain.


sidki
Add Thank You Quote this message in a reply
Post Reply 


Messages In This Thread
[] - z12 - Jul. 29, 2004, 12:58 AM
[] - ProxRocks - Jul. 29, 2004, 02:33 AM
[] - z12 - Jul. 29, 2004, 03:32 AM
[] - Siamesecat - Jul. 29, 2004, 07:31 AM
[] - ProxRocks - Jul. 29, 2004, 11:27 AM
[] - z12 - Jul. 29, 2004, 01:54 PM
[] - sidki3003 - Jul. 29, 2004, 02:32 PM
[] - ProxRocks - Jul. 29, 2004, 03:59 PM
[] - Siamesecat - Jul. 29, 2004, 08:18 PM
[] - z12 - Jul. 30, 2004, 02:26 AM
[] - Siamesecat - Jul. 30, 2004, 08:23 AM
[] - sidki3003 - Jul. 30, 2004 10:57 AM
[] - z12 - Jul. 30, 2004, 11:16 AM
[] - z12 - Jul. 30, 2004, 11:39 AM
[] - z12 - Jul. 30, 2004, 01:36 PM
[] - ProxRocks - Jul. 30, 2004, 03:43 PM
[] - Oddysey - Jul. 30, 2004, 04:49 PM
[] - z12 - Jul. 30, 2004, 06:45 PM
[] - z12 - Jul. 30, 2004, 06:48 PM
[] - sidki3003 - Jul. 30, 2004, 07:41 PM
[] - sidki3003 - Jul. 30, 2004, 07:49 PM
[] - sidki3003 - Jul. 30, 2004, 08:22 PM
[] - ProxRocks - Jul. 30, 2004, 08:23 PM
[] - Oddysey - Jul. 30, 2004, 10:33 PM
[] - z12 - Jul. 30, 2004, 11:33 PM
[] - Siamesecat - Jul. 30, 2004, 11:56 PM
[] - sidki3003 - Jul. 31, 2004, 05:14 PM

Forum Jump: