使用通配符在word中实现高级查找和替换
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Find and Replace using wildcards
This tutorial pre-supposes that the user will have some
basic experience of Word's 'replace' function.
The secret of using wildcard searches is to identify the
unique string of text that you wish to find. Wildcards are
combined with regular text and formatting options to
represent the characters or sequences of characters in
that string. Because different combinations of characters
can be represented by a variety of wildcard combinations,
there is often more than one way of identifying a particular
string of text within a document. How you choose to
represent that group of characters is therefore a matter of
individual preference; and the context of the text within the
document will to a great extent dictate the most suitable
combination to use on a particular occasion.
Start by identifying the string you wish to replace and then
pop up the replace function (CTRL+H) or select Advanced
Find from the Editing group on the Home tab of the
ribbon (see below); or in earlier Word versions Edit >
Replace.
Click the 'More' button to present the additional functions and check the 'Use wildcards' option:
Insert your find and replace strings using the following guide for inspiration.
You can paste any (Unicode) character - unfortunately
*not* characters from decorative (Symbol) fonts) - into your search expressions. So copying the first and last characters from the Greek or cyrillic subsets into a search:
[;-ώ] would match any Greek character α β γ δ ε...
<[Ё-ґ]@> matches any cyrillic word: Вы можете помочь мне?(“Can you help me please?”)
In Word 2000, you can type in Unicode characters with the Alt-key (make sure NumLock is on, then hold down the Alt-key and type the numbers on the numeric keyboard). Since all characters from decorative fonts (Symbol-, Wingdings-fonts ...) are kept in a special code page from &HF000 to &HF0FF, you can search for them with
[Alt61472-Alt61695].
Gotchas .
You may wish to identify a character string by means of a
paragraph mark ¶. The normal search string for this would
be ^p.
^p DOES NOT WORK in wildcard search strings! It must
however be used in replacement strings, but when
searching, you must look for the substitute code ^13.
Wildcard searches will also not find footnote/endnote
marks - substitute ^2.
A-z would be expected to reproduce all the letters between
A and z i.e. both upper case and lower case letters, which
it does, but it reproduces all the characters from ASCII 65
to ASCII 122, and that block also includes the characters [ ]
` ^ _ / Use A-Za-z instead.
The question mark ? is used to find individual characters.
If used with curly brackets to define a range of characters
eg
#?{1,3}# it will behave as an asterisk and find all the
characters between the hash symbols.
Control Codes that may be used with the search/replace tool
/?kbid=197855