Learn by Doing wrote: > Thanks Marnen. I am trying to use regular expression to replace the > text "spec" in TextMate with "mug". I am trying to avoid instances of > "spec" where it does not mean the name of the model, e.g. "aspect". > So I use the following regular expression: [^a-zA-Z]spec . That > would catch "@spec" which is what I want. But if I tell TextMate to > replace that with "mug", I lose the character before "spec". TextMate > replaces "@spec" with "mug" . How can I make it replace @spec with > @mug ? >
Most regexp syntaxes support backreferences in the replace string, which is what you need. Check TextMate's documentation to see how it implements backreferences. > Thanks. Best, -- Marnen Laibow-Koser http://www.marnen.org [email protected] -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

