[TxMt] Re: Regular expression to replace code

Allan Odgaard mailinglist at textmate.org
Sat Nov 23 02:50:36 UTC 2013

On 22 Nov 2013, at 13:57, Ross Ahmed wrote:

> Perhaps the whole question didn't get posted
> I would select is.numeric(mean(mtcars$mpg)), hit use as find, and use 
> a regular expression to replace is.numeric(mean(mtcars$mpg)) with 
> mean(mtcars$mpg) […]

Assuming the outer function name is only word characters and inner 
function is word characters or the dollar sign, you can search for: 

Then replace with $1 (capture register one).

I would recommend that you study regular expressions and also 
TextMate’s format strings, for the more TextMate specific stuff, here 
are some useful links:

  - 1.x manual: 
  - extended 2.0 grammar: 
  - blog post example for 2.0: 

More information about the textmate mailing list