[TxMt] Re: help writing a command

Hans-Jörg Bibiko bibiko at eva.mpg.de
Sun Jul 8 13:36:09 UTC 2012


On Jul 8, 2012, at 2:53 PM, Kyle Johnson wrote:

> I'm not savvy enough to see how to write a simple command for Textmate 2, and I'm wondering if anyone can help get me started.
> 
> The command should search the current file for "ch:\d" where \d is one or two digits and spit that/those digits out where the cursor is.

Could you please give us an example or be more specific? Spit out: where to? What do you mean with "where the cursor is"?

This regular expression will match "ch:" followed by one or two digits:

ch:(\d{1,2})

and the regex variable $1 contains the found digit(s). Then the question arises whether ch:123 could occur as well? Etc. 

Cheers,
--Hans





More information about the textmate mailing list