[TxMt] regex help

Allan Odgaard throw-away-1 at macromates.com
Thu Jan 26 23:31:17 UTC 2006


On 26/1/2006, at 18:26, Will Arp wrote:

> this is my code
> 		{	name = 'rebol.string';
> 			begin = '"';
> 			end = '"';
> 		},
> which obviously dosn't work for this case.

Make a sub-rule to handle escape sequences:

{	name = 'string.quoted.double.rebol';
	begin = '"';
	end = '"';
	patterns = (
		{	name = 'constant.character.escaped.rebol';
			match = '\^.';
		}
	);
},

The sub-rule matches ^ followed by «some character», so if you write  
^" inside the string, it's swallowed by the sub-rule, and thus won't  
end the string.






More information about the textmate mailing list