[OS X TeX] duplicate words

Alan Munn amunn at gmx.com
Tue Jul 27 08:42:32 EDT 2010


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







More information about the MacOSX-TeX mailing list