[TxMt] Find/Replace Variables in Document?

Charilaos Skiadas cskiadas at uchicago.edu
Mon Feb 20 02:02:41 UTC 2006


Hi Court,
On Feb 19, 2006, at 7:48 PM, Court K wrote:

> I'd like to find and replace a variable inside of a document. How  
> can I do this? [VAR] Represents the variable:
>
> Find: title="[VAR]"
>
> Replace With: title="dummytext"
>
>
> Text in Document I want it to affect:
> title="Webmaill"
> title="Control Panel"
> title="Customer Service"
> title="Web Hosting"
>
> How can I do this in TextMate?
>
Do a find and replace, where the regular expression checkbox is  
selected. Then, in the find box, put:
title="[^"]"
and in the replace part whatever you want it to be replaced with. If  
you want to actually use the [VAR] part in your replacement, then do  
a find for:
title="([^"])"
and in the replacement, use $1 for wherever you want each var to show  
up.
You'll probably also want to read this:
http://macromates.com/textmate/manual/ 
regular_expressions#regular_expressions.

>
> Best Regards,
>
> Court Kizer

Haris





More information about the textmate mailing list