[OS X TeX] [OT] TextWrangler multiple file replace

Rob Rye rowenrye at gmail.com
Fri Jul 23 17:57:17 EDT 2010

Hi Alan,

Your example below contains 3 \'s. So far as I can tell you have one too many \'s in your replace string.

When I do essentially what you indicate you want to do using grep in a multi-file search and replace in TextWrangler, but only have two \\'s (one to escape it in grep and the other to place the escape character into the LaTeX document) in the replace string it works just fine.

My entries in the relevant fields in the TW GUI:

Find: [&$%]

Replace: \\&


On Jul 23, 2010, at 12:10 PM, Alan Munn wrote:

> Sorry this is only vaguely on topic.  I have a bunch of text files that I would like to do a global replace of the &,$, %  that need to be escaped in LaTeX.  If open one of the files, and do the following search using grep:
> [&$%]
> replace with
> \\\&
> It correctly finds instances of these characters and does the correct replacement.
> However, if I try the same search using the multi-file search, (also using grep) it returns with "The pattern [&$%] was not found.", yet I know there are instances in the files (since I can do the same search on any single file.)
> Can someone confirm this behaviour and/or tell me what I'm doing wrong?
> Thanks
> Alan
> -- 
> Alan Munn
> amunn at gmx.com
> ----------- Please Consult the Following Before Posting -----------
> TeX FAQ: http://www.tex.ac.uk/faq
> List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
> List Archive: http://tug.org/pipermail/macostex-archives/
> TeX on Mac OS X Website: http://mactex-wiki.tug.org/
> List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

More information about the MacOSX-TeX mailing list