Setting up a library of Find(s)

General questions about using TextPad

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

Post Reply
geoffreykidd
Posts: 35
Joined: Thu Aug 02, 2007 8:50 pm

Setting up a library of Find(s)

Post by geoffreykidd »

I've got a small collection of Regular Expressions, and I'd like to be able to save them in a library where I can click on them and have them immediately entered as the "Find what:".

Is there any way to set this up so I don't have to load the RegEx into a separate file, and copy/paste that into the "Find"?

Note: I need this because I need to be certain it's the right expression, and the "find history" dropdown can be confusing when more than one similar expression at a time is in it.
User avatar
Mike Olds
Posts: 226
Joined: Wed Sep 30, 2009 3:27 pm
Contact:

Post by Mike Olds »

You can create a new clip book. It won't put the expression in the find dialog, but it will keep the exppressions handy. You can then click on one to place it in a convenient place and copy that into the find or replace dialog.
Thank you, and
Best Wishes,
Obo
http://buddhadust.net/
check out the What's New? Oblog:
http://buddhadust.net/dhammatalk/dhamma ... ts.new.htm
geoffreykidd
Posts: 35
Joined: Thu Aug 02, 2007 8:50 pm

Post by geoffreykidd »

Thank you, Mike. I did that, but was hoping there was an easier way to get "canned" stuff into the finder field. Possibly up the line there will be a way to mark certain "find" entries as favorites. Meanwhile, this gets my work done.
User avatar
woho
Posts: 100
Joined: Tue Sep 02, 2003 9:12 am
Location: Steyr/Austria
Contact:

Post by woho »

100% support for your idea; I use the same workaround and it would save lot of work having a regexp library as you described
User avatar
kengrubb
Posts: 324
Joined: Thu Dec 11, 2003 5:23 pm
Location: Olympia, WA, USA

Post by kengrubb »

I too see value in this function. The solution I use is Ditto with my Finds saved in the Ditto database and mark them Never Auto Delete.

http://ditto-cp.sourceforge.net/
(2[Bb]|[^2].|.[^Bb])

That is the question.
User avatar
jeffy
Posts: 323
Joined: Mon Mar 03, 2003 9:04 am
Location: Philadelphia

Post by jeffy »

I personally do this type of thing in PhraseExpress, a Windows scripting program free for personal use. http://www.phraseexpress.com/download.php

Here's a PhraseExpress import-file. This is indented for clarity, but must be UN-indented in order to import it into PhraseExpress. DUPLICATE the file, un-indent that duplicate, then import THAT file.

my_regexes_ddmenu.px.txt:

Code: Select all

My regexes -- mrx	.	mr
	Other regexes -- mrxp (mxp[1-4])	.	mrx
		^\t+([^\t])	^\t+([^\t])	mrxp
		([A-Za-z0-9_]+)	([A-Za-z0-9_]+)	mrxp
	([...]+)	([]+){#LEFT -count 3}	mrx
(This is three columns, tab-delimited: Description, phrase-body, and autotext)

When you install it as I say below, you can type "mrx", and you'll see a pop-up with
  • Other regexes -- mrxp
    ([...]+)
Then, if you add a "p", you'll see
  • ^\t+([^\t])
    ([A-Za-z0-9_]+)
Click on any item (use your down arrow, then type a TAB--I think it's a tab), and the regex will be typed.

It's a bit of a pain to get it started, but once it is started, you'll fly. It's really easy to edit your regex drop-down (just re-import it).

ONE-TIME-ONLY SETUP

Before importing the regex-drop-down file for the first-time, create a folder in PhraseExpress called "Drop-down menus". Select the folder and:
- Click the "Expert Options" button, on the bottom right
- Prefix drop-down: None
- Manual confirm checked

IMPORTING THE FILE

-1- Open PhraseExpress, and move it to the right-side of your screen.
-2- Open a Windows Explorer window containing the UN-INDENTED drop-down file.
-3- Drag the file from explorer into the "Drop-down menus" folder.
-4- A dialog pops up with four radio options. Choose the bottom option (one phrase-per-line) then press OK.
-5- Import it with TAB as the delimiter char, and the "description-phrasebody-autotext" format. Confirm.

That's it. Now close PhraseExpress, and you should be able to use it as I mention above.

Each change you make to the import-text file, follow the IMPORTING steps.

Of course, you could create this heirarchy directly in PhraseExpress, but I recommend against it. Once you start creating stuff in PhraseExpress, you're trapped in it. I MUCH prefer editing my phrases in TextPad (there's no REGEX replacement in PhraseExpress, for example). While PhraseExpress has MANY options for importing, there's only ONE option for exporting.

---

I know this is a lot, but it is a very useful and quick-to-update thing once you get the hang of it. Ask me questions and I'll help you through the setup.
Post Reply