From: Alex M. <ah...@st...> - 2005-07-05 15:48:33
|
On Jul 3, 2005, at 4:53 PM, Adam R. Maxwell wrote: > > On Jul 2, 2005, at 19:04, Curtis Clifton wrote: > > >> On Jul 2, 2005, at 8:46 PM, Alex Montgomery wrote: >> >> >> >>> If it isn't, though, it looks for a string with any case matching >>> the one input - but the replace string is substituted using the >>> exact case put in, whereas I *think* it should be adapted. >>> >>> An example: Suppose I want to replace all examples of "this" with >>> "that," adapting to the case of the found item. If Case Sensitive >>> isn't checked, it should replace >>> >>> This -> That >>> this -> that >>> >>> But it currently would replace >>> >>> This -> that >>> this -> that >>> >>> There may be other opinions, of course, but that's my 2 cents. >>> > > I don't think that's expected behavior for most users; TextEdit > doesn't behave this way, for instance, although I'd be interested > to hear of counter examples. True. TeXShop and TextWrangler don't behave that way. On the other hand, Word does. So in terms of "expected" behavior, you're probably right, except for us recent converts. >> I'm not sure that I would say it "should" be this way, but having >> the option would be awesome. Some applications call this behavior >> "Clone Case". > > Patches welcome :). Check out the documentation for pcre at > <http://pcre.org/pcre.txt> to see how much of this you can do with > a regex (conditional branching, maybe?). Well, just about anything can be done with enough knowledge of regex. Or, of course, I could do two separate case sensitive searches in the above example, one for "This" replaced with "That" and one for "this" replaced with "that" -AHM |