[TxMt] Matching nested pairs

Gavin Kistner gavin at refinery.com
Sat Oct 8 20:31:24 UTC 2005


On Oct 8, 2005, at 2:45 AM, Allan Odgaard wrote:
> On 08/10/2005, at 10.39, Allan Odgaard wrote:
>> On 08/10/2005, at 6.54, Gavin Kistner wrote:
>>>             begin = '(?<!--)\[\[';
>> If the negative look-behind on “--” is to avoid “[[” in a comment,  
>> then just make a rule to match “--.*$” (or similar) and you won't  
>> need to resort to look-behind etc.
> That's be begin = "--\[\[" for a multi-line comment with the same  
> nesting as Michael Sheet showed (I seem to recall that multi-line  
> comments can have some sort of nesting!?!)

Correct - Lua multi-line comments start with "--[[" and end with  
"]]", and (like multi-line strings) can contain nested [[ .. ]] pairs.


More information about the textmate mailing list