What is the Wildcard code to find a bracket followed by the word "NOTE" followed by any number of characters until an end bracket? For example, I'd like to find these excerpts:
[NOTE: res ipsa loquitur res ipsa loquitur res ipsa loquitur res ipsa loquitur]
or
[NOTE: ipsa loquitur res ipsa loquitur res ipsa loquitur res ipsa loquitur res]
Wildcard code to search for any number of characters
-
- SilverLounger
- Posts: 2389
- Joined: 28 Mar 2010, 01:49
Wildcard code to search for any number of characters
Regards,
JMT
JMT
-
- Administrator
- Posts: 78494
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Wildcard code to search for any number of characters
Make sure that you tick the check box 'Use wildcards'. Enter the following in the 'Find what' box:
The \ before [ and ] is required because [ and ] have special meanings in a wildcard search. Preceding them with \ tells Word that you're searching for the literal characters [ and ].
Code: Select all
\[NOTE: *\]
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans
Hans
-
- SilverLounger
- Posts: 2389
- Joined: 28 Mar 2010, 01:49
Re: Wildcard code to search for any number of characters
It did not work for me. I think a single * tells Word I am looking for a single character only. However, I might need any number of characters before the ].
Regards,
JMT
JMT
-
- Administrator
- Posts: 78494
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Wildcard code to search for any number of characters
No. ? is the wildcard for a single character, and * for any number of characters. I tested the expression in the screenshot, and it worked. Are you sure that you have ticked the 'Use wildcards' check box?
Best wishes,
Hans
Hans
-
- SilverLounger
- Posts: 2389
- Joined: 28 Mar 2010, 01:49
Re: Wildcard code to search for any number of characters
Now it is working. I don't know why it was not working before; I had the Use wildcards ticked both times.
Thank you.
Thank you.
Regards,
JMT
JMT
-
- SilverLounger
- Posts: 2389
- Joined: 28 Mar 2010, 01:49
Re: Wildcard code to search for any number of characters
If * searches any number of characters, why doesn't it find the word "an" or "and" when I search "a an and"? It is only finding individual letters, even when I have Wildcards selected.
Regards,
JMT
JMT
-
- 4StarLounger
- Posts: 508
- Joined: 17 Dec 2010, 03:14
Re: Wildcard code to search for any number of characters
The wildcard expression posted by Hans (i.e. \[NOTE:*\]) is correct for the example you posted.
To find more than just the specified character(s) when using *, you have to give some indication of where to stop, otherwise a* erroneously might be expected to find all of "a an and" - and everything else in the document after the first 'a'. To find whole words "a" "an" & "and", you'd use: <a*>
To find more than just the specified character(s) when using *, you have to give some indication of where to stop, otherwise a* erroneously might be expected to find all of "a an and" - and everything else in the document after the first 'a'. To find whole words "a" "an" & "and", you'd use: <a*>
Paul Edstein
[Fmr MS MVP - Word]
[Fmr MS MVP - Word]