Thanks Marnen!

I will surely look into back references next time.  Before I got your
answer, I managed to do this manually by replacing "Spec" then "spec" when
preceded with each of the special characters: @ : ' " / - ! space.  I
downloaded and used "Name Mangler" to replace "spec" in file names.   While
tedious, you are right that it is not too difficult.  Cucumber seems to work
now.  I am ready to dive into BDD.

Thank you so much for your help.

Vincent

On Tue, Jan 26, 2010 at 11:07 PM, Marnen Laibow-Koser
<[email protected]>wrote:

> 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]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
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.

Reply via email to