wildcard only finds "Wednesday"

M

muybn

I'm frustrated with the following wildcard Search statement that's only
finding "Wednesday" as the day of the week:
<[A-Z][a-z]{2,5}day>,^32<[A-Z][a-z]{2,8}>^32<[0-9]{1,2}>,^32<[1-2][0-9]{3}>^13

By rights, it should find any day of the week (with the phrase
"[A-Z][a-z]{2,5}day"). Samples of what it should find (in a paragraph) are:

Sunday, November 14, 1982
Wednesday, June 10, 2002
Saturday, May 8, 1007

All min/max constraints work just fine (e.g., {2,8}, {1,2} and {3}), but the
first one ({2,5}) is only interpreted by Word as {5}. However, it should
search for the second two letters in Sunday, Monday and Friday; the 2nd-5th
letters in Tuesday; the 2nd-7th letters in Wednesday; and the 2nd-6th letters
in Thursday and Saturday. (Use the above samples in a document and you'll see
what I mean.)

Can anyone see what I'm doing wrong? Anything else I do (such as "[a-z]{3}"
instead of "day") produces an error of "The Find What text contains a Pattern
Match which is too complex."
 
G

Greg Maxey

I can't explain it why it doesn't work. It does seem like it should.

This works: [A-Z][a-z]@day
I'm frustrated with the following wildcard Search statement that's
only finding "Wednesday" as the day of the week:
<[A-Z][a-z]{2,5}day>,^32<[A-Z][a-z]{2,8}>^32<[0-9]{1,2}>,^32<[1-2][0-9]{3}>^13

By rights, it should find any day of the week (with the phrase
"[A-Z][a-z]{2,5}day"). Samples of what it should find (in a
paragraph) are:

Sunday, November 14, 1982
Wednesday, June 10, 2002
Saturday, May 8, 1007

All min/max constraints work just fine (e.g., {2,8}, {1,2} and {3}),
but the first one ({2,5}) is only interpreted by Word as {5}.
However, it should search for the second two letters in Sunday,
Monday and Friday; the 2nd-5th letters in Tuesday; the 2nd-7th
letters in Wednesday; and the 2nd-6th letters in Thursday and
Saturday. (Use the above samples in a document and you'll see what I
mean.)

Can anyone see what I'm doing wrong? Anything else I do (such as
"[a-z]{3}" instead of "day") produces an error of "The Find What text
contains a Pattern Match which is too complex."
 
D

Doug Robbins - Word MVP

The following will find each of the days of the week

<[A-Z]{1}[! ]*day>

but not the word holiday in the phrase

A holiday.



--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
T

Tony Jollans

I can't explain it either. Word's pattern matching has always had a mind of
its own but this is extreme - it looks like something is broken.

--
Enjoy,
Tony

www.WordArticles.com

Greg Maxey said:
I can't explain it why it doesn't work. It does seem like it should.

This works: [A-Z][a-z]@day
I'm frustrated with the following wildcard Search statement that's
only finding "Wednesday" as the day of the week:
<[A-Z][a-z]{2,5}day>,^32<[A-Z][a-z]{2,8}>^32<[0-9]{1,2}>,^32<[1-2][0-9]{3}>^13

By rights, it should find any day of the week (with the phrase
"[A-Z][a-z]{2,5}day"). Samples of what it should find (in a
paragraph) are:

Sunday, November 14, 1982
Wednesday, June 10, 2002
Saturday, May 8, 1007

All min/max constraints work just fine (e.g., {2,8}, {1,2} and {3}),
but the first one ({2,5}) is only interpreted by Word as {5}.
However, it should search for the second two letters in Sunday,
Monday and Friday; the 2nd-5th letters in Tuesday; the 2nd-7th
letters in Wednesday; and the 2nd-6th letters in Thursday and
Saturday. (Use the above samples in a document and you'll see what I
mean.)

Can anyone see what I'm doing wrong? Anything else I do (such as
"[a-z]{3}" instead of "day") produces an error of "The Find What text
contains a Pattern Match which is too complex."
 
T

Tony Jollans

Posted too soon - I can explain it; the problem is caused by the fact that
the letter d is contained within the range [a-z].

Word will match the longest string it can against each part of the pattern,
and <[A-Z][a-z]{2,5} is matched by "Sunday"; the character following this is
"," so the whole pattern is not matched. Every day except Wednesday would be
matched by <[A-Z][a-c,e-z]{2,5} but that doesn't really help you.

--
Enjoy,
Tony

www.WordArticles.com

Tony Jollans said:
I can't explain it either. Word's pattern matching has always had a mind of
its own but this is extreme - it looks like something is broken.

--
Enjoy,
Tony

www.WordArticles.com

Greg Maxey said:
I can't explain it why it doesn't work. It does seem like it should.

This works: [A-Z][a-z]@day
I'm frustrated with the following wildcard Search statement that's
only finding "Wednesday" as the day of the week:
<[A-Z][a-z]{2,5}day>,^32<[A-Z][a-z]{2,8}>^32<[0-9]{1,2}>,^32<[1-2][0-9]{3}>^13

By rights, it should find any day of the week (with the phrase
"[A-Z][a-z]{2,5}day"). Samples of what it should find (in a
paragraph) are:

Sunday, November 14, 1982
Wednesday, June 10, 2002
Saturday, May 8, 1007

All min/max constraints work just fine (e.g., {2,8}, {1,2} and {3}),
but the first one ({2,5}) is only interpreted by Word as {5}.
However, it should search for the second two letters in Sunday,
Monday and Friday; the 2nd-5th letters in Tuesday; the 2nd-7th
letters in Wednesday; and the 2nd-6th letters in Thursday and
Saturday. (Use the above samples in a document and you'll see what I
mean.)

Can anyone see what I'm doing wrong? Anything else I do (such as
"[a-z]{3}" instead of "day") produces an error of "The Find What text
contains a Pattern Match which is too complex."
 

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