in reply to Re^2: Beautiful .. operator
in thread Beautiful .. operator

take everything between /start/ and (/end/ which is not inside other /start/ .. /end/ block)

That would be

start b f j end

but I get

start b start c d e end f start g h i end j end

from /start/ .. (!(/start/../end/) && /end/)

Replies are listed 'Best First'.
Re^4: Beautiful .. operator
by grizzley (Chaplain) on Oct 29, 2008 at 07:58 UTC

    It seems its harder to explain as I thought...

    This is exactly the output I wished: to get everything between outer 'start' and 'end'

      How about:
      take top level /start/ .. /end/ blocks, including nested /start/ .. /end/ blocks
      Well, that looks like the intention anyway. Intersting stuff.

      It's unfortunate that the level of nesting needs to be known in advance. The solution would be to replace the use of the binary flip-flop operator with the numeric flip-flop operator. Ie the operator that pre-increments every time its left hand operand is true, and post-decrements every time its right hand operand is true, stays the same otherwise, and returns the result of the calculation.

      For some reason, I can't "remember" how the operator is written. Ie what should replace .. to make it numeric, not binary? Any suggestions?

      --
      .sig : File not found.