Scripted Regular Expressions

Ideas for new features

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply

How important is it to you, to have this feature implemented into future versions of TextPad?

Important, even if the size/efficiency of TextPad increases/degrades
3
19%
Somewhat important
4
25%
I'm okay either way
7
44%
Somewhat unimportant
2
13%
Unimportant, even if the size/efficiency of TextPad remains unaffected
0
No votes
 
Total votes: 16

User avatar
trids
Posts: 69
Joined: Wed May 07, 2003 10:16 am
Location: South Africa

Scripted Regular Expressions

Post by trids »

Until editable macros are available (and perhaps even afterwards!), it would be extremely useful to be able to define search-and-replace edits with regular expressions in a script.

This script could be nominated by the user from the current [Replace] dialog. But most importantly, it provides the opportunity to debug AND automate lengthy or complicated edits .. even before editable macros are ready.
User avatar
jeffy
Posts: 323
Joined: Mon Mar 03, 2003 9:04 am
Location: Philadelphia

Post by jeffy »

I'm not clear on what you mean by this. Could you please elaborate? Thanks.
User avatar
trids
Posts: 69
Joined: Wed May 07, 2003 10:16 am
Location: South Africa

Post by trids »

I'm thinking of the script as a separate file, perhaps with the following conventions:

Each line contains a find/replace pair of Regular Expressions, separated by a tab-character. The first RegExp is the pattern for the target, and the one after the tab is the "replace" expression. a second tab-character could separate a documentary comment for the line.

Having these find-replace combinations in such a file achieves the editability requirement.

Each such file (identified with a suitable extension, like clipbooks) can be listed in a dropdown listbox in the [Replace] dialog. From this listbox, the user can select a pre-defined script of edits to apply.

The conventions above are simply a suggestion. Another might be to offer a clipbook-style dialog to edit the regexp scripts. I like the file idea as it offers more flexibility in terms of formatting and editing.
Post Reply