[TxMt] matching question

Allan Odgaard throw-away-1 at macromates.com
Wed Apr 19 01:13:05 UTC 2006


On 18/4/2006, at 22:28, Aparajita Fishman wrote:

> [...] Is there any way to have the first and last lines of the  
> fusedoc rule be parsed by text.xml?

Yes, use look-ahead and look-behind assertions in the begin/end  
patterns. E.g.:

    fusedoc =
    { begin = '(?=^\s*<fusedoc )';
      end = '(?<=</fusedoc>)';
      patterns = ( { include = 'text.xml'; } );
    }

This way, the patterns themselves will match zero characters.

Look-behind however can only be fixed width, so there is no way to  
ensure that ‘^\s*’ is in front of the end-tag.





More information about the textmate mailing list