[OS X TeX] duplicate words

Alan Munn amunn at gmx.com
Tue Jul 27 10:47:34 EDT 2010


On Jul 27, 2010, at 10:34 AM, Claus Gerhardt wrote:

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

Sorry Claus, you're right on this.  I was testing in TeXShop as well,  
which doesn't have this option, and I wasn't using it.  So Manuel's  
version works independently of whether you have the "Entire Word"  
option or not.

Alan

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

-- 
Alan Munn
amunn at gmx.com







More information about the MacOSX-TeX mailing list