[OS X TeX] duplicate words

Robert R. Bruner ad5336 at wayne.edu
Tue Jul 27 10:39:32 EDT 2010


Makes me remember SNOBOL.
The good old days :-)

Bob


----- Original Message -----
From: "Claus Gerhardt" <gerhardt at math.uni-heidelberg.de>
To: "TeX on Mac OS X Mailing List" <macosx-tex at email.esm.psu.edu>
Sent: Tuesday, July 27, 2010 10:34:41 AM
Subject: Re: [OS X TeX] duplicate words

I wonder why nobody read the correction to my (actually) first message, which unfortunately had been published first, which works as advertised:

"In BBEdit do a grep search

(\w+)\s+\1

and check "Entire word" in addition."

Claus



On Jul 27, 2010, at 14:42, Alan Munn wrote:

> On Jul 27, 2010, at 5:17 AM, Luis Sequeira wrote:
> 
>> Actually, the kind of regexp search that has been mentioned works also in TeXShop:
>> 
>> Try
>> 
>> (\w+)\s+\1\s+
>> 
>> (with regular expressions on)
>> and click Find All.
> 
> 
> Let's put this to rest.  As I pointed out in my reply to Vic, this regexp doesn't actually work, and Claus's original works better.  However, his also has some flaws (it will find the 'y's in the phrase "my yarn" (thanks to Vic for noticing this).  A regexp that does work and fixes both problems is the following (building on Manuel's suggestion (which doesn't work either, since \< and \> aren't recognised delimiters in either BBEdit or TeXShop. (Unless in the latter it depends on which style of regexp you have set)
> 
> Anyway, the following regexp really does work:
> 
> \b(\w+)\b\s+\1
> 
> Try it (and the others if you're so inclined) on the following test sentence to see:
> 
> 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
> 


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