[TxMt] Re: Conditional regex

Oliver Taylor olivertaylor at me.com
Fri May 29 17:33:04 UTC 2009


On Wed, May 27, 2009 at 7:30 AM, Dijk van Marc <marcvdijk at gmail.com> wrote:

> Would anyone of you be so kind to provide me with a more elaborate
> answer/example?

{	name = 'meta.test';
	match = '^(ATOM|HETATM).*(GLN)';
	captures = {
		1 = { name = 'keyword.first-match'; };
		2 = { name = 'string.second-match'; };
	};
}

This should color each match differently. Please note that there are
many different ways to do this and may not be the best way for your
needs.

Do yourself a favor and look up some regex tutorials on the web. They
will help immensely.

--oliver



More information about the textmate mailing list