Page 1 of 1
Whole words when searching
Posted: Tue Mar 23, 2004 10:29 am
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
Posted: Tue Mar 23, 2004 10:51 am
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.
Posted: Tue Mar 23, 2004 10:57 am
by hallyhaa
Yes, but then I wont find occurances like
"one"
one.
one,
one/
etc...
HY
Posted: Tue Mar 23, 2004 11:22 am
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.
Posted: Mon May 10, 2004 9:37 pm
by kengrubb
hallyhaa,
I believe the solution you are seeking is to search "[^[:token:]]one[^[:token:]]" without the double quotes.
HTH,
Posted: Tue May 11, 2004 7:50 am
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
Posted: Fri Jun 04, 2004 9:08 pm
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,