Whole words when searching

General questions about using TextPad

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

Post Reply
hallyhaa
Posts: 5
Joined: Tue Mar 23, 2004 10:18 am
Contact:

Whole words when searching

Post by hallyhaa »

Hello

I have the '-' character as part of words in my rebol document class. Double clicking on words correctly selects e.g. this-is-one-single-word.

But when I search for, say, 'one', and I check 'Match whole words', TextPad will find 'one' in this-is-one-single-word.

Is there a way to avoid this?

Thanks,
HY
Prætera censeo Carthaginem esse delendam
User avatar
helios
Posts: 710
Joined: Sun Mar 02, 2003 5:52 pm
Location: Helios Software Solutions
Contact:

Post by helios »

You could type a space after the word "one", in the Find dialog box. This will also find the space. so you will have to include a space at the end of any repacement you make.
Helios Software Solutions
hallyhaa
Posts: 5
Joined: Tue Mar 23, 2004 10:18 am
Contact:

Post by hallyhaa »

Yes, but then I wont find occurances like
"one"
one.
one,
one/

etc...

HY
Prætera censeo Carthaginem esse delendam
User avatar
helios
Posts: 710
Joined: Sun Mar 02, 2003 5:52 pm
Location: Helios Software Solutions
Contact:

Post by helios »

Please try implementing the following procedure in TextPad:

1. Open the Replace dialog box
2. Type or paste "[^-]?one[^-].?" without the quotes into the "Find what"
section
3. Under the heading "Conditions", check "Text and Regular expression"
5. Click "Find Next"

I have used POSIX regular expression syntax, which can be selected from the Editor page of the Preferences dialog box.

I hope this helps.
Helios Software Solutions
User avatar
kengrubb
Posts: 324
Joined: Thu Dec 11, 2003 5:23 pm
Location: Olympia, WA, USA

Post by kengrubb »

hallyhaa,

I believe the solution you are seeking is to search "[^[:token:]]one[^[:token:]]" without the double quotes.

HTH,
(2[Bb]|[^2].|.[^Bb])

That is the question.
hallyhaa
Posts: 5
Joined: Tue Mar 23, 2004 10:18 am
Contact:

Post by hallyhaa »

No, Kengrubb, not exactly. What I want is for TextPad's search box to treat this-is-one-single-word as one entire word when the currently used document class defines '-' as part of words. It shouldn't be the texpad user's job to figure out a regexp.

That said, I'm sure your regexp works just fine.

Regards,
HY
Prætera censeo Carthaginem esse delendam
User avatar
kengrubb
Posts: 324
Joined: Thu Dec 11, 2003 5:23 pm
Location: Olympia, WA, USA

Post by kengrubb »

HY,

I believe there are two issues here. First, you are reporting a problem with TextPad that you'd like corrected, and you are certainly correct about this behavior of TextPad.

The second issue is solutions to get you closer to where you'd like to be. I understand a reluctance to Regular Expressions in the Find dialog, particularly if this function is something you use a lot. However, a Macro could easily be recorded to use the contents of the Clipboard in the Find and the Macro itself could be mapped to a key combination.

HTH,
(2[Bb]|[^2].|.[^Bb])

That is the question.
Post Reply