[TxMt] RegExp n00b
Allan Odgaard
allan at macromates.com
Wed Sep 14 20:11:40 UTC 2005
On 14/09/2005, at 11.17, Andreas Wahlin wrote:
> [...] Is the name syntax correct?
Looks okay, yes.
> 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)
You may be interested to know that Michael Sheets has been working on
an XHTML strict syntax which not only mark up every single tag/
attribute, but also marks up invalid stuff (like badly nested tags,
text where no text is allowed etc.)
It's in the Experimental HTML bundle at the repository, but it'll be
included when he gives the green light.
>> 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 :(
Because (?options:subexp) is not a capture, so you actually need:
begin = "<((?i:img))\\b";
An alternative form would be:
begin = "(?i)<(img)\\b";
More information about the textmate
mailing list