Word uses expressions to set complex find-and-replace methods

Source: Internet
Author: User

The original data is shown in Figure 1.

The effect of the replacement is shown in Figure 2.

First step, formatting replacement tags

Objective: To replace the space between the idioms with the paragraph mark, so as to achieve the format of the substitution mark.

How to: Cursor positioning at the beginning of the article, press the shortcut key "Ctrl+h" up the "Find and Replace" settings box, click the Replace tab, and in the Find what column, enter []@* ([A-龥]) (without quotes), and enter "^P1" (without quotes) in the Replace with column. Click All after the search option, tick the Use wildcard check box, and select the Replace All button.

Description: Wildcard meaning in an expression: [] represents a full or half-width space, @ represents more than 1 previous characters or expressions, * represents any string, [one-龥] represents any single Chinese character, () represents an expression group, and 1 represents the first expression.

The meaning of the expression in the lookup bar: Find the content that begins with a full or half-width space followed by several spaces or any string until the first character is encountered.

Replace the meaning of an expression in a column by replacing a lookup with a paragraph mark, except for the Chinese part.

Second step, personalized replacement effect

Objective: To arbitrarily exchange or remove typos in parentheses and correct words before parentheses, thus achieving the personalized effect of substitution.

Replace effect 1: Parentheses follow typos, suitable for suggestive exercises

Operation Steps:

1, in parentheses is a word of the idiom exchange, the form of "sigh (sigh)" sighs. In the Find what column, type (*) ([one-龥]) ([((]) ([A-龥]) ([)]]) (*) ^13 (without quotes), enter "143256^13" (without quotes) in the Replace with column. Click the Replace All button. As shown in Figure 4.

Wildcard meaning in an expression: [(] denotes a full-width or half-width parenthesis, ^13 represents a paragraph mark (used only when the Use wildcard check box is checked). 1 to 6 correspond to the portion of the expression enclosed in parentheses in the lookup bar, respectively.

The meaning of the expression in the lookup column: Find "contains an idiom that is enclosed in full-width or half-width parentheses, and in the middle is a Chinese character, and finally ends with a paragraph mark."

Replace the meaning of an expression in a column to exchange a single typo in parentheses with a single Chinese character before parentheses.

2, the parentheses are two words in the exchange of idioms. In the Find what column, type (*) ([A-龥]{2}) ([((]) ([A-龥]{2}) ([)]) (*) ^13 (without quotes), the other settings are the same as the previous step, and click the Replace All button.

Wildcard meaning in an expression: [A-龥]{2} represents any two Chinese characters.

Replace the meaning of an expression in a column: Swap the two typos in parentheses with the two characters before the brackets.

3, clear the parentheses is a word idiom in the correct content. Like "sigh () sighs". In the Find what column, type ([((]) ([A-龥]) ([)]) "(without quotes), enter" 1 3 "in the" Replace with "field (without quotes, two spaces between 1 and 3). Click the Replace All button.

The meaning of the expression in the lookup column: find "enclosed in full-width or half-width parentheses, and in the middle is the content of a Chinese character."

Replace the meaning of an expression in a column: Replace a single typo in parentheses with a space.

4, clear the parentheses is the correct content in the two-word idiom. In the Find what column, enter ([(()) ([A-龥]{2}]]) (without quotes), the other settings are the same as the previous step, and click Replace All.

The meaning of the expression in the lookup column: find "enclosed in full-width or half-width parentheses, with two Chinese characters in the middle".

Replace the meaning of an expression in a column: replace the two typos in parentheses with spaces.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.