[OS X TeX] Another TeXShop search/replace bug

Herbert Schulz herbs at wideopenwest.com
Fri Nov 9 11:32:27 EST 2007


On Nov 9, 2007, at 10:27 AM, Alan Munn wrote:

> At 10:20 AM -0600 11/9/07, Herbert Schulz wrote:
>> On Nov 9, 2007, at 9:55 AM, Alan Munn wrote:
>>
>>> Hi everyone.  This is NOT related to Leopard.  I've previously  
>>> noted bugs in the OgreKit regex search/replace functions with  
>>> respect to ^ matching.
>>>
>>> Here's another bug. I'd appreciate if anyone can confirm it (or  
>>> tell me what I'm doing wrong.)
>>>
>>> Construct a file with the following: (namely: >, tab, 1, period)
>>>
>>>> 	1.
>>>
>>> Now do the following regexp replace:
>>>
>>> Find:
>>>
>>> [> \t][0-9]\,
>>>
>>> Replace with:
>>>
>>> foo
>>>
>>> The result is
>>>
>>>> foo
>>>
>>> Instead of the correct
>>>
>>> foo
>
>> Does
>>
>>> [ \t][0-9]\.
>>
>> work?
>
> No (sorry for the typo in my original message (see my own followup  
> correcting this)  The issue seems to be the replacement of the >  
> character.
>
> Alan
>


Howdy,

Don't know what happened but I moved the `>' just outside of the  
square brackets: >[ \t][0-9]\.

I think it's doing the shortest match so the first square bracket  
expression says `pick > or space or tab', etc. and the tab makes the  
shortest match. Moving the `>' outside the brackets means `pick >  
followed by either space or tab', etc.

Good Luck,

Herb Schulz
(herbs at wideopenwest.com)



------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the MacOSX-TeX mailing list