wildcards in find and replace

R

Rick McCormack

Mac G4, OS X.2.6, Word X 10.1.4
The curly brackets in the find dialog do not work. A search for
a{2,12} should find and highlight groups of a if there are between 2
and 12 contiguous a's. instead, it finds each individual a.

Things I tried: typing in the curly brackets, inserting from the special
drop-down, copying from text and from "Insert symbol" -- plus a few
more I can't even remember.

I posed a similar message in the general Word newsgroup before I
found this Mac-specific one.
 
B

Beth Rosengard

Hi Rick,

There was a similar thread posted yesterday (Crash when using wildcards in
"Find" function). I'm in Word 2001 and couldn't make curly brackets work
properly there either. (You did have "Use Wildcards" checked, didn't you?)

Can anyone else using Word 10.1.4 or 10.1.2 test this wildcard search for
a{2,12} as well as for the example in the previous thread :{15,} (which was
to find 15 or more colons in a row)... and report back.

Thanks.

--
Beth Rosengard
Mac MVP

Mac Word FAQ: <http://www.mvps.org/word/FAQs/WordMac/index.htm>
Entourage Help Page: <http://www.entourage.mvps.org/toc.html>
 
B

Beth Rosengard

Hi Corentin,

I tried it and it highlighted every occurence of 1 to 12 "a"

You mean it worked properly or that it highlighted each "a" individually?
I tried that as well and Word picked up all occurences of ":" one after
the other (but not a group of ":::::::::::::::". It behaves as it were
simply ignoring the wildcar.

Right. It appears to be a bug that was carried over from Word 2001 (unless
someone who's still in 10.1.2 tries it and it works there). Will you report
it?

--
Beth Rosengard
Mac MVP

Mac Word FAQ: <http://www.mvps.org/word/FAQs/WordMac/index.htm>
Entourage Help Page: <http://www.entourage.mvps.org/toc.html>
 
R

R Morris

Beth Rosengard said:
Hi Corentin,



You mean it worked properly or that it highlighted each "a" individually?


Right. It appears to be a bug that was carried over from Word 2001 (unless
someone who's still in 10.1.2 tries it and it works there). Will you report
it?


I have Office 10.1.3 with MacOS 10.2.3
(updated to 10.1.3 before I realised I didn't need to! - and 10.1.4 is
too big for an ordinary phone line connection - sorry - off topic)

Trying Beth's tests (as suggested in post of 20th to Rick)

with Find :{15,} Word quits every time, doc saved or not

with Find a{2,12} no quits but simply finds and highlights the next "a"
whether in a string or not - does not highlight any strings of "a"s of
any length (also doc saved or not)

My conclusions:
15 colons - definite NO-NO
{ } find - doesn't work
Saving doc first makes no difference
 
R

R Morris

[snip]
I have Office 10.1.3 with MacOS 10.2.3
(updated to 10.1.3 before I realised I didn't need to! - and 10.1.4 is
too big for an ordinary phone line connection - sorry - off topic)

Trying Beth's tests (as suggested in post of 20th to Rick)

with Find :{15,} Word quits every time, doc saved or not

with Find a{2,12} no quits but simply finds and highlights the next "a"
whether in a string or not - does not highlight any strings of "a"s of
any length (also doc saved or not)

My conclusions:
15 colons - definite NO-NO
{ } find - doesn't work
Saving doc first makes no difference

Further -
is there something magic about 15 colons?

I've tried with 13, 14, 16, 17 and don't get the crashes
(although the wildcard Find only highlights single ":" at a time)
 
C

Corentin Cras-Méneur

Beth Rosengard said:
Hi Corentin,

Hi Beth,
You mean it worked properly or that it highlighted each "a" individually?

It highlighted each a individually.


[...]
Right. It appears to be a bug that was carried over from Word 2001 (unless
someone who's still in 10.1.2 tries it and it works there). Will you report
it?

Sure.

Corentin
 
J

Janaki

Hi Beth,
Janaki back again. This problem is curiouser and curiouser (read
below)
I did your experiment (on a Mac G4; OX 10.2.6; Word 10.1.4):
1) Create a Word document that contains text including 15 contiguous colons
as well as groups of from 2 to 12 contiguous letter a's.

2) Do NOT save the document; just leave it open.

3) Do a wildcard search (Edit> Find> click on More> check Use Wildcards) by
entering :{15,} in the Find What field and then click Find Next.

What happens? Does Word crash? If not, does it find and highlight the
groups of 15 colons or does it only find and highlight one colon at a time?

It crashed at this step, like it had for me before.
If Word did crash, open it, repeat #1 above only this time DO save the
document, and then repeat #3. Any crashes? Are the results the same?

Crashed again, with the :{15,}
If you still have the patience to try some more experiments, repeat all of
the above except in #3, change the Find What field to read a{2,12} and
report on the results.

as others have noted, this finds each occurance of "a" individually,
but not as the expected string.

Now I went on a bit further, and tried the original colon search, but
using different numbers, and got some very strange results:

:{2} - found each ":" individually (just like the "a" example)
:{3} - found each ":" individually
:{4} - displayed message "Word has finished searching the document.
The search item was not found"
:{5} - same as {4} ("search item not found")
:{6} - found each ":" individually
:{7} - "search item not found"
:{8} - this one actually found ":::", which astonished me!! at least
it's a string!
:{9) - found each ":" individually
:{10}- found each ":" individually
:{11} - crashed
:{12} - "search item not found"
:{13} - "search item not found"
:{14} - found each ":" individually
:{15} - crashed
:{16} - found each ":" individually
:{17} - found each ":" individually
:[18} - found each ":" individually
:{19} - found each ":" individually
:{20} - found each ":" individually

and then i got bored, and gave up. i did go back to :{4} and it's
definitely reproducible on my machine. I also revisited the :{8}
condition just now, and went a bit further to find another odd
behavior: if you keep hitting "Find Next" it finds each consecutive
set of 3-colons ":::" up to the end of the line, and then continues to
"find" the next 3 chars "::paragraph" and then then next time wraps
to highlight the last ":", the paragraph char, and the first "a" on
the next line. then it finally gives up and says it can't find any
more occurrences.

So, many thanks to all who have chimed in on this bug, since it makes
me feel less stupid about my machine not doing what i expect. my only
other question, now, is "would this behavior crop up if i tried
writing the same F&R into a macro?"

thanks,
janaki
 

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