$TSTing positional vars
|
Feb. 04, 2009, 11:10 AM
Post: #1
|
|||
|
|||
$TSTing positional vars
http://code.google.com/hosting/search?q=label:proxy
The below filter seems cause a loop so the page won't stop loading. Code: Google: Multi URL Untangler 8.04.04 (multi) [sd jjoe] (d.s) |
|||
Feb. 04, 2009, 02:18 PM
Post: #2
|
|||
|
|||
RE: $TSTing positional vars
Thanks whenever.
I've split this post, because i'd like to explain what's happening here, because you don't get any hints from the "dbug.." view. It's an undocumented Prox quirk: Empty positional vars temporarily aren't empty but contain the maximum bytes possible, until the respective positional var knows that it is supposed to be empty. That doesn't matter, unless you $TST the respective var. Test filter: Code: [Patterns] Test code 1 (things go wrong -- \0 has nothing real to grab): Code: <test>xxx111222xxx</test> Test code 2 (thing work as expected -- \0 has a whitespace to grab): Code: <test>xxx111 222xxx</test> As for the Google untangler, if you change "\sonmousedown" to "onmousedown", then \7 can grab a space. |
|||
Feb. 05, 2009, 05:06 AM
Post: #3
|
|||
|
|||
RE: $TSTing positional vars
(Feb. 04, 2009 02:18 PM)sidki3003 Wrote: Empty positional vars temporarily aren't empty but contain the maximum bytes possibleI saw the result in the test code 1. Thanks for this information. (Feb. 04, 2009 02:18 PM)sidki3003 Wrote: until the respective positional var knows that it is supposed to be empty.What does this mean? (Feb. 04, 2009 02:18 PM)sidki3003 Wrote: As for the Google untangler, if you change "\sonmousedown" to "onmousedown", then \7 can grab a space.That fixed the issue. |
|||
Feb. 05, 2009, 01:43 PM
Post: #4
|
|||
|
|||
RE: $TSTing positional vars
(Feb. 05, 2009 05:06 AM)whenever Wrote:(Feb. 04, 2009 02:18 PM)sidki3003 Wrote: until the respective positional var knows that it is supposed to be empty.What does this mean? Above explanation is my working hypothesis, so could be incorrect. Positional vars were designed to be expanded only in the replacement. Except for a few commands that can expand them immediately, like $LOG and $ADDLST. The $TST command is rather new, IIRC. |
|||
Oct. 21, 2010, 02:19 AM
Post: #5
|
|||
|
|||
RE: $TSTing positional vars
Testing against
Code: <title>google</title> Code: [Patterns] Test filter "A". This filter should not match but does! Test should fail because \0 should have no value. Test filter "B". Test should fail because \0 should have no value and does fail. The left side of "(|\0)" matches 'nothing' and keeps \0 empty. Is there a better workaround? Of interest, the test window results aren't always the same as the real world. Code: [Patterns] Test window shows Code: \0 is Actual page shows Code: <Match: C -- incorrect: \0 is empty, $TST(\0=*) should not match > |
|||
Oct. 21, 2010, 03:13 PM
(This post was last modified: Oct. 21, 2010 03:16 PM by sidki3003.)
Post: #6
|
|||
|
|||
RE: $TSTing positional vars
(Oct. 21, 2010 02:19 AM)JJoe Wrote: The left side of "(|\0)" matches 'nothing' and keeps \0 empty. It depends on the actual situation. Normally you can rearrange your matching expression, so that the positional variable always has something to capture. Which is what i prefer. As a rule of thumb, matching is quicker than failing. If rearranging isn't possible, your workaround looks fine. Quote:Of interest, the test window results aren't always the same as the real world. The last (third) replace line in the page code example is still there, but further down the page. |
|||
Oct. 21, 2010, 06:03 PM
Post: #7
|
|||
|
|||
RE: $TSTing positional vars
(Oct. 21, 2010 03:13 PM)sidki3003 Wrote:Quote:Of interest, the test window results aren't always the same as the real world. I missed seeing that but I did see the Proxomitron incorrectly adding and removing code (some unintelligible). Code: [Patterns] Test1 doesn't match every "google". **ogle is not where it might be expected to be (search the page). Code: [Patterns] Doesn't match... |
|||
Oct. 21, 2010, 06:45 PM
Post: #8
|
|||
|
|||
RE: $TSTing positional vars
(Oct. 21, 2010 06:03 PM)JJoe Wrote: Yeah, same effect as with the "C" filter in your last post: \0 is filled with a whole lot of chars, more than 256 (byte limit) anyway. See post #2. Quote: That's the 6a case (new 1-11 numbering): Techniques.txt Wrote:6a You can't test a positional variable that has been previously assigned with |
|||
Oct. 21, 2010, 09:29 PM
Post: #9
|
|||
|
|||
RE: $TSTing positional vars
Agreed but I guessed otherwise for variables.
From help SRL Wrote:The value a variable is set to isn't "expanded" until it's actually called in the replacement text. This means if \1 is "fish" and you use a SET command like $SET(\2=\1 food), the \2 will not become "fish food" but will be literally set to "\1 food". However this will be expanded to "fish food" when \2 is printed in the replacement section. Regardless, Code: [Patterns] Doesn't match google. Does match gostuffhereogle but doesn't fill \1. $TST((\0)=*) would provide a test for value, however. Best advice is 'If rearranging isn't possible, use (|\X).' |
|||
Oct. 22, 2010, 10:12 PM
Post: #10
|
|||
|
|||
RE: $TSTing positional vars
(Oct. 21, 2010 09:29 PM)JJoe Wrote: From help This thread as well as mentioned "Techniques.txt" document is about undocumented "nuances" (as Mona labeled them). "undocumented" means "not part of the official documentation". Each statement in Techniques.txt is followed by examples, allowing you to verify it. |
|||
Oct. 22, 2010, 11:40 PM
Post: #11
|
|||
|
|||
RE: $TSTing positional vars
Ummm. I wasn't disagreeing or intending to express doubt or disrespect. Simply "thinking out loud" and then explaining myself.
Sorry |
|||
Oct. 10, 2011, 03:51 AM
Post: #12
|
|||
|
|||
RE: $TSTing positional vars
Just a quick note that the latest version of the "Google: Multi URL Untangler" filter is causing the same issue as what the post one described again. Sorry I don't have time to look into it though.
Code: Google: Multi URL Untangler 11.08.13 (multi) [sd jjoe] (d.s) |
|||
« Next Oldest | Next Newest »
|