在MS WORD里进行查找和替换的高级技巧

Find and replace text or other items with MS Word
Some of the content in this topic may not be applicable to some languages.

Use Microsoft Word to find and replace text, formatting, paragraph marks, page breaks (page break: The point at which one page ends and another begins. Microsoft Word inserts an "automatic" (or soft) page break for you, or you can force a page break at a specific location by inserting a "manual" (or hard) page break.), and other items. You can extend your search by using wildcards and codes.

HideFind text

You can quickly search for every occurrence of a specific word or phrase.

  1. On the Edit menu, click Find.
  2. In the Find what box, enter the text that you want to search for.
  3. Select any other options that you want.

    To select all instances of a specific word or phrase at once, select the Highlight all items found in check box, and then select which portion of the document you want to search in by clicking in the Highlight all items found in list.

  4. Click Find Next or Find All.

    To cancel a search in progress, press ESC.

HideReplace text

You can automatically replace text — for example, you can replace "Acme" with "Apex."

  1. On the Edit menu, click Replace.
  2. In the Find what box, enter the text that you want to search for.
  3. In the Replace with box, enter the replacement text.
  4. Select any other options that you want.
  5. Click Find Next, Replace, or Replace All.

    To cancel a search in progress, press ESC.

HideFind and replace specific formatting

You can search for and replace or remove character formatting. For example, find a specific word or phrase and change the font color, or find specific formatting such as bold and remove or change it.

  1. On the Edit menu, click Find.
  2. If you don't see the Format button, click More.
  3. In the Find what box, do one of the following:
    • To search for text without specific formatting, enter the text.
    • To search for text with specific formatting, enter the text, click Format, and then select the formats you want.
    • To search for specific formatting only, delete any text, click Format, and then select the formats you want.
  4. Select the Highlight all items found in check box to find all instances of the word or phrase, and then select which portion of the document you want to search in by clicking in the Highlight all items found in list.
  5. Click Find All.

    All instances of the word or phrase are highlighted.

  6. Click Close.
  7. On the Formatting toolbar (toolbar: A bar with buttons and options that you use to carry out commands. To display a toolbar, press ALT and then SHIFT+F10.), click buttons to make changes. For example, select a different font color, click Bold Button image, and then click Italic Button image.

    The changes you make are applied to all the highlighted text.

  8. Click anywhere in the document to remove highlighting from the text.

HideFind and replace paragraph marks, page breaks, and other items

You can easily search for and replace special characters and document elements such as page breaks and tabs.

  1. On the Edit menu, click Find or Replace.
  2. If you don't see the Special button, click More.
  3. In the Find what box, do one of the following:
    • To choose the item from a list, click Special, and then click the item you want.
    • Type a code for the item directly in the Find what box.
  4. If you want to replace the item, enter what you want to use as a replacement in the Replace with box.
  5. Click Find Next, Replace, or Replace All.

    To cancel a search in progress, press ESC.

    HideTip

    For a quick way to find items such as graphics or comments (comment: A note or annotation that an author or reviewer adds to a document. Microsoft Word displays the comment in a balloon in the margin of the document or in the Reviewing Pane.), click Select Browse Object Button image on the vertical scroll bar, and then click the item you want. You can click Next Button image or Previous Button image to find the next or previous item of the same type.

HideFind and replace noun or adjective forms or verb tenses

You can search for:

HideSingular and plural noun forms

For example, replace "apple" with "orange" at the same time that you replace "apples" with "oranges".

HideAll adjective forms

For example, replace "worse" with "better" at the same time that you replace "worst" with "best".

HideAll tenses of a root verb

For example, replace "sit" with "stand" at the same time that you replace "sat" with "stood".

  1. On the Edit menu, click Find or Replace.
  2. If you don't see the Find all word forms check box, click More.
  3. Select the Find all word forms check box.
  4. In the Find what box, enter the text you want to find.
  5. If you want to replace the text, enter the replacement text in the Replace with box.
  6. Click Find Next, Replace, or Replace All.
  7. If the replacement text is ambiguous, click the word that best matches the meaning you want.

    For example, "saw" can be both a noun and a verb; click "saws" to replace nouns, or click "sawing" to replace verbs.

    To cancel a search in progress, press ESC.

Notes

  • If you're replacing text, it's a good idea to click Replace instead of Replace All; that way, you can confirm each replacement to make sure it's correct.
  • Use the same part of speech and tense for both the search and replacement text. For example, search for "see" and replace it with "observe" (both are verbs in the present tense).

Search by using wildcards

HideUse wildcards to find and replace

For example, use the asterisk (*) wildcard to search for a string of characters ("s*d" finds "sad" and "started").

  1. On the Edit menu, click Find or Replace.
  2. If you don't see the Use wildcards check box, click More.
  3. Select the Use wildcards check box.
  4. Enter a wildcard character in the Find What box. Do one of the following:
    • To choose a wildcard character from a list, click Special, click a wildcard character, and then type any additional text in the Find what box.
    • Type a wildcard character directly in the Find what box.
  5. If you want to replace the item, enter what you want to use as a replacement in the Replace with box.
  6. Click Find Next, Replace, or Replace All.

    To cancel a search in progress, press ESC.

Notes

  • When the Use wildcards check box is selected, Word finds only the exact text you specify. (Notice that the Match case and Find whole words only check boxes are unavailable (dimmed) to indicate that these options are automatically on; you can’t turn off these options.)
  • To search for a character that's defined as a wildcard, type a backslash (/) before the character. For example, type /? to find a question mark.

HideWildcards for items you want to find and replace

To find:

Any single character

Type ?
For example, s?t finds "sat" and "set".

Any string of characters

Type *
For example, s*d finds "sad" and "started".

The beginning of a word

Type <

For example, <(inter) finds "interesting" and "intercept", but not "splintered".

The end of a word

Type >
For example, (in)> finds "in" and "within", but not "interesting".

One of the specified characters

Type [ ]

For example, w[io]n finds "win" and "won".

Any single character in this range

Type [-]
For example, [r-t]ight finds "right" and "sight". Ranges must be in ascending order.

Any single character except the characters in the range inside the brackets

Type [!x-z]

For example, t[!a-m]ck finds "tock" and "tuck", but not "tack" or "tick".

Exactly n occurrences of the previous character or expression

Type {n}

For example, fe{2}d finds "feed" but not "fed".

At least n occurrences of the previous character or expression

Type {n,}

For example, fe{1,}d finds "fed" and "feed".

From n to m occurrences of the previous character or expression

Type {n,m}

For example, 10{1,3} finds "10", "100", and "1000".

One or more occurrences of the previous character or expression

Type @

For example, lo@t finds "lot" and "loot".

Notes

  • You can use parentheses to group the wildcard characters and text and to indicate the order of evaluation. For example, type <(pre)*(ed)> to find "presorted" and "prevented".
  • You can use the /n wildcard to search for an expression and then replace it with the rearranged expression. For example, type (Ashton) (Chris) in the Find what box and /2 /1 in the Replace with box. Word will find "Ashton Chris" and replace it with "Chris Ashton".

Search by using codes

HideUse codes to find and replace

  1. On the Edit menu, click Find or Replace.

  2. If you don't see the Special button, click More.

  3. Enter a code in the Find What box. Do one of the following:
    • To choose a code from a list, click Special, click a character, and then type any additional text in the Find what box.
    • Type a code directly in the Find what box.

      For example, type ^p to find a paragraph mark.

  4. If you want to replace the item, enter what you want to use as a replacement in the Replace with box.
  5. Click Find Next, Replace, or Replace All.

    To cancel a search in progress, press ESC.

HideCodes for items you want to find and replace

As specified, some codes work only if the Use wildcards option is on or off.

Codes that work in the Find what or Replace with box

To specify:

Paragraph mark (Paragraph mark)

Type ^p (doesn’t work in the Find what box when wildcards are on) or type ^13

Tab character (Tab character)

Type ^t or type ^9

ASCII character

Type ^nnn, where nnn is the character code

ANSI character

Type ^0nnn, where 0 is zero and nnn is the character code

Em dash ( — )

Type ^+

En dash ( – )

Type ^=

Caret character

Type ^^

Manual line break (Manual line break)

Type ^l or type ^11

Column break

Type ^n or type ^14

Page or section break

Type ^12 (when replacing, inserts a page break)

Manual page break

Type ^m (also finds or replaces section breaks when wildcards are on)

Nonbreaking space (Nonbreaking space)

Type ^s

Nonbreaking hyphen (Nonbreaking hypen)

Type ^~

Optional hyphen (Optional hyphen)

Type ^-

Code that works in the Find what box only (when wildcards are on)

Picture or graphic (inline only)

Type ^g

Codes that work in the Find what box only (when wildcards are off)

Any character

Type ^?

Any digit

Type ^#

Any letter

Type ^$

Unicode character

Type ^Unnnn where nnnn is the character code

Picture or graphic (inline only)

Type ^1

Footnote mark

Type ^f or type ^2

Endnote mark

Type ^e

Field

Type ^d

Opening field brace (when field codes are visible)

Type ^19

Closing field brace (when field codes are visible)

Type ^21

Comment

Type ^a or type ^5

Section break

Type ^b

Em space (Unicode)

Type ^u8195

En space (Unicode)

Type ^u8194

White space

Type ^w (any combination of regular and nonbreaking spaces, and tab characters)

Codes that work in the Replace with box only

Windows Clipboard contents

Type ^c

Contents of the Find what box

Type ^&

Notes

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值