Page 1 of 1

Preserve Capitalization in Find / Replace

Posted: Sun Mar 09, 2003 3:12 am
by Mike Kloster
I would like to have a find / replace expression that does the following:

convert

Code: Select all

public void setName() { return name;}
to

Code: Select all

public void setOther() { return other;}
in *one* expession. That is, I want to find any instance of 'name' and replace it with 'other' preserving the capitalization of the first letter. So, in one find/replace 'name' becomes 'other' and 'Name' becomes 'Other'.

Is this doable in the current version of Textpad? If not, would this be considered for a future release?

Mike

Preserve Case

Posted: Tue Mar 18, 2003 12:30 am
by Roy Beatty
I suspect that case destruction (is that the right term) is a characteristic of the Regular Expression engine used in TextPad, rather than a behavior programmed in by Helios itself.

It seems like a very reasonable request to me -- If I were you I'd post it at http://www.textpad.com/support/index.html as an "Enhancement Request". Chances are that recompiling the app with some different options set, or getting a regex engine upgrade would do the trick.

Good luck,

Roy

Posted: Thu Mar 27, 2003 10:21 pm
by Peter Wone
Although I understand the request and the motivation, I can't agree that it's a reasonable request. As the RE engine stands:
  • It can do what is required.
  • Its behaviour is orthogonal.
  • Its behaviour is simple.
Key to understanding my objection is the fact that we are discussing the behaviour of a regular expression engine. Modifying it to directly support a specialised requirement like this would make it an irregular expression engine. One of the great joys of using Textpad is the very low bug count. I swear that it's the most stable non-trivial software I have ever used. This reliability stems from the fact that each of the building blocks does exactly one thing in a very orthogonal way. Personally I'd like to see it stay that way.

The request is kind of like saying "Excel is a great spreadsheet but there's no ComputeTaxReturn function, this would be very handy, can we include one?"

Use two expressions. There's no charge.

That said, it's great to see that people are taking sufficient advantage of Textpad for such a question to arise. I've been using it since 1993, got around to registering it in 1995, which must be the longest genuine evaluation in history, and I'm pleased to see Helios surviving the IT downturn.