MatchWholeWord

D

DaveL

I am trying to use matchwholeword with Find but I'm not getting what I want
and I think it is because I don't understand how whole words are defined. As
an example, if I search for "Select" I will get ".Select" or "_Select", or
"Select_" etc. Is there something that explains exactly how a whole word
search works with other characters other than spaces?
 
F

fumei via OfficeKB.com

I do not understand.

If MatchWholeWords = True then if you search for "Select", then it will find
"Select" in:

Select
_Select
Select_

but it will not find "Select" in "Selection"

Are you saying you are doing something and whatever it is, is also affecting
the ".", the "_"?

It should not be.
 
D

David Horowitz

I haven't tested it thoroughly, but Whole Word Only searching will treat
letters and numbers as part of a word, and anything else (punctuation,
spaces, tabs) as delimiters.
So if you search for "select" and Whole Words Only is selected, it will
find:
select
_select
select_
select?
select.
de-select
<space>select
etc.
BUT NOT
selection
select123
123select
deselect
Does this clarify?
 
D

DaveL

Gentlemen,

Thanks for responding. Mr Horowitz interpreted my poor question correctly
and the explanation was very helpful on how whole word works (don't
understand why MS doesn't explain this somewhere). I guess I'll have to make
two passes: one to find all the "Select" cases and then another to exclude
the "Select" cases that are preceded or followed by anything other than
spaces and other characters I will allow. If anyone has a better suggestion
I would appreciate it.

Thanks for your time.

David Horowitz said:
I haven't tested it thoroughly, but Whole Word Only searching will treat
letters and numbers as part of a word, and anything else (punctuation,
spaces, tabs) as delimiters.
So if you search for "select" and Whole Words Only is selected, it will
find:
select
_select
select_
select?
select.
de-select
<space>select
etc.
BUT NOT
selection
select123
123select
deselect
Does this clarify?
 
D

David Horowitz

You could probably use some special wildcards for this.
For example, let's say you're looking for these possibilities:
select
_select
select_
:select
select:
You might use a wildcard search instead of a WholeWord search.
It might look something like this:
[:_}+select[:_]+
Which means find zero or one occurrences of : or _ followed by select
followed by zero or one occurrences of : or _.
You'll probably need to EXCLUDE certain characters to get exactly what
you're looking for, like you don't want it to be preceded or followed by any
letters, so maybe you need something more along the lines of:
[^a-z]select[^a-z]
If you combine the two somehow, maybe that gets you what you want. Without
knowing your exact criteria, I can't give you something 100% accurate.
David
--
David Horowitz
Lead Technologist
Soundside Inc.
www.soundside.biz
DaveL said:
Gentlemen,

Thanks for responding. Mr Horowitz interpreted my poor question
correctly
and the explanation was very helpful on how whole word works (don't
understand why MS doesn't explain this somewhere). I guess I'll have to
make
two passes: one to find all the "Select" cases and then another to exclude
the "Select" cases that are preceded or followed by anything other than
spaces and other characters I will allow. If anyone has a better
suggestion
I would appreciate it.

Thanks for your time.
 
D

DaveL

Mr. Horowitz,

Thanks. I think you are correct. I need to spend some time working with
the various wild cards together with additions, or even exclusions, of
characters. I'm sure the answer is there somewhere.

Thanks again

Dave

David Horowitz said:
You could probably use some special wildcards for this.
For example, let's say you're looking for these possibilities:
select
_select
select_
:select
select:
You might use a wildcard search instead of a WholeWord search.
It might look something like this:
[:_}+select[:_]+
Which means find zero or one occurrences of : or _ followed by select
followed by zero or one occurrences of : or _.
You'll probably need to EXCLUDE certain characters to get exactly what
you're looking for, like you don't want it to be preceded or followed by any
letters, so maybe you need something more along the lines of:
[^a-z]select[^a-z]
If you combine the two somehow, maybe that gets you what you want. Without
knowing your exact criteria, I can't give you something 100% accurate.
David
--
David Horowitz
Lead Technologist
Soundside Inc.
www.soundside.biz
DaveL said:
Gentlemen,

Thanks for responding. Mr Horowitz interpreted my poor question
correctly
and the explanation was very helpful on how whole word works (don't
understand why MS doesn't explain this somewhere). I guess I'll have to
make
two passes: one to find all the "Select" cases and then another to exclude
the "Select" cases that are preceded or followed by anything other than
spaces and other characters I will allow. If anyone has a better
suggestion
I would appreciate it.

Thanks for your time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top