View previous topic :: View next topic |
Author |
Message |
z12
Sergeant
Joined: Jul 17, 2002
Posts: 135
Location: USA
|
Posted: Sat Mar 13, 2004 8:14 am Post subject: |
|
|
For code Injection, let's say you want to inject some code before every TD tag:
Code: |
Filter Name:TD Inject Test
Bounds Match:<td*>
Matching Expression:\0
Replacement Text:<MyCode>\0
|
would do the trick.
But now suppose you also have a filter that changes every TD tag that has a background color property.
Code: |
Filter Name:Td color changer
Bounds Match:<td*>
Matching Expression:(*\sbgcolor=)\0(\w)\1\2
Replacement Text:\0"#4184BE"\2
|
If the filters are entered in the order shown, the "TD color changer" filter will never match. What's needed is multi match capability.
If "Allow for multiple matches" is checked on the "TD Inject Test", there's going to be trouble. Proxo will get caught in a endless matching loop.
If instead, "Allow for multiple matches" is checked on the "TD color changer", the "TD color changer" still won't match.
The solution would be to reverse the filter order and "check" the "Allow for multiple matches" for the "TD color changer".
This is just one example of code injection. Depending on what your trying to do, other solutions may be better.
Mike
|
|
Back to top |
|
|
SK12
Trooper
Joined: Mar 08, 2004
Posts: 11
Location: USA
|
Posted: Mon Mar 15, 2004 6:49 am Post subject: |
|
|
Thanks for advices, now I got some more learning and trying to do |
|
Back to top |
|
|
SK12
Trooper
Joined: Mar 08, 2004
Posts: 11
Location: USA
|
Posted: Wed Mar 17, 2004 11:13 am Post subject: |
|
|
I ran into new problems again. Now I am trying to prevent the filter from matching certain subpages and to match all the others. Like this:
Code: |
URL Match: *.ess.fi*&(^(http://www.ess.fi/cgi-bin/uusinetlari/index.pl?osasto=74))&$TYPE(htm)
|
to not to match page with osasto=74 as its id.
But it won't work for some reason. Is there something missing in the syntax or does it have some errors?
EDIT: I got it working now. If anyone else is interested then, there was error in the syntax - it should have been like this:
Code: |
*.ess.fi*&(^(www.ess.fi/cgi-bin/uusinetlari/index.pl?osasto=74))&$TYPE(htm)
|
without http://
|
|
Back to top |
|
|
SK12
Trooper
Joined: Mar 08, 2004
Posts: 11
Location: USA
|
Posted: Fri Mar 19, 2004 9:57 am Post subject: |
|
|
A new problem appeared. When I try to make the filter not to mach certain sub URL:s, it also doesnt match some others
Here is the URL match:
Code: |
*.ess.fi*&(^(www.ess.fi/cgi-bin/uusinetlari/index.pl?(osasto=74|osasto=28|osasto=11)))&$TYPE(htm)
|
It should only rule out matching for the URL with osasto=11 (and 74 and 28 ), but it also doesn't match 111 and 110 any more. This seems very weird Does it have something to do with the last asterisk in *.ess.fi* ?
|
|
Back to top |
|
|
z12
Sergeant
Joined: Jul 17, 2002
Posts: 135
Location: USA
|
Posted: Fri Mar 19, 2004 5:25 pm Post subject: |
|
|
Hi Sven, the match issue your having with 110 and 111 is due to:
osato=11
since this will match any number begining with 11.
It would help to see an actual url that your having problems with, but try this:
osasto=(11|28|74)[^1-9]
Mike |
|
Back to top |
|
|
SK12
Trooper
Joined: Mar 08, 2004
Posts: 11
Location: USA
|
Posted: Sat Mar 20, 2004 2:38 am Post subject: |
|
|
Mike, thanks! That was the problem - I put that one digit exclusion this way: [^0-9] to exclude 0,too. I am getting very close to getting the whole newspaper fixed |
|
Back to top |
|
|
Lepus
Trooper
Joined: Mar 02, 2004
Posts: 15
Location: USA
|
Posted: Sat Mar 20, 2004 3:25 am Post subject: |
|
|
You can also try a numeric match like so....
osasto=([#11]|[#28]|[#74])
since it parses the full number it won't consider "11" the same as "111" |
|
Back to top |
|
|
|