[TxMt] RegExp n00b

Andreas Wahlin andreaswahlin at bredband.net
Wed Sep 14 09:17:47 UTC 2005


Oh, ABOVE the stuff, it all seems to work now, just to check back  
that I did the right thing, and perhaps to have it included in HTML  
syntax later on? My bundle file now looks like this:

         {    name = "declaration.tag.html";
             begin = "<(img)\\b";
             end = ">";
             captures = { 1 = { name = "entity.name.img.tag.html"; }; };
             patterns = ( { include = "#tag-stuff"; } );
         },
         {    name = "declaration.tag.html";
             begin = "</?(div)\\b";
             end = ">";
             captures = { 1 = { name = "entity.name.div.tag.html"; }; };
             patterns = ( { include = "#tag-stuff"; } );
         },
         {    name = "declaration.tag.html";
             begin = "</?([a-zA-Z0-9:]+)";
             end = ">";
             captures = { 1 = { name = "entity.name.tag.html"; }; };
             patterns = ( { include = "#tag-stuff"; } );
         },

The last one there was in the original, and is just there to show  
where I placed the rest :)
Is the name syntax correct?
I'm planning on adding scopes for form tags as well, all in order to  
emulate dreamweaver syntax colouring some day. (The img tag was for  
bbedit syntax)

> The (?i:...) means that ... should be matched case insensitive.

oh, that means I should probably have
             begin = "<(?i:img)\\b";
in the match to catch all <IMG tags as well ... but that, again  
sadly, does not seem to work :(


Andreas



More information about the textmate mailing list