[OS X TeX] Search with .* but how to replace?

Alain Schremmer schremmer.alain at gmail.com
Thu Apr 24 20:45:53 EDT 2014


At Welsh and Schulz

I will try both suggestions later on tonight and, shame on me, I did  
not look up the help in TextWrangler which I have used a lot (to make  
a change across a whole lot of files.)

Very grateful regards
--schremmer


On Apr 24, 2014, at 8:33 PM, Michael Welsh wrote:

> On 25/04/2014, at 1157, Alain Schremmer <schremmer.alain at gmail.com>  
> wrote:
>>
>> I am trying to replace, say, f(x) by g(x)h(x) where x can be any  
>> string.
>>
>> In OgreKit, f(.*) finds the occurrences of f(x) which it selects in  
>> its entirety but I was not able to find on google how then to let  
>> it replace it by g(x)h(x).
>>
>> Hopeful regards
>> --schremmer
>
>
> As long as x doesn't contain any (), the following works:
>
> Set search syntax to Perl (click on more options) and escape  
> character to \.
>
> Then search
> f\((.*?)\)
>
> and replace
> g(\1)h(\1)
>
> For a good place to read about this, I suggest the TextWrangler  
> (free from the App Store) help.




More information about the MacOSX-TeX mailing list