Post Reply 
$NEST|$INEST : less than L loops
Dec. 18, 2009, 07:50 PM
Post: #1
$NEST|$INEST : less than L loops
Code:
[Patterns]
Name = "$NEST less than L loops"
Active = FALSE
Limit = 25600
Match = "<(table)\1"
        "$SET(L=iii)"
        "&"
        "$NEST(<$TST(\1)"
        "($SET(c=$GET(c)i)(^$TST(c=$TST(L)))"
        "|$SET(L=)$SET(c=))$TST(L=ii+),</$TST(\1) >)"
        "$TST(L=ii+)"
        "$SET(L=)$SET(c=)"

Test against:

Code:
<table>III
<table>II
<table>I
</table>
</table>
</table>

Result:

Code:
<table>III

</table>

Change iii in $SET(L=iii) to vary maximum number of loops allowed,
ii is less than two,
iii is less than three,
etc.

Basic idea should also work with $INEST.
More tests can be added.

I haven't done much with it.
Report oddities.

Have fun
Add Thank You Quote this message in a reply
Post Reply 


Messages In This Thread
$NEST|$INEST : less than L loops - JJoe - Dec. 18, 2009 07:50 PM
RE: $NEST|$INEST : less than L loops - JJoe - Dec. 18, 2009, 11:40 PM

Forum Jump: