WPS and Word documents under Office, use wildcards for advanced replacement

This article mainly introduces how to use wildcards to partially replace specified content in word documents, for example, replace `AXB` with `AAB`. Let’s throw a specific question directly. We know that in English, most symbols must be followed by spaces, which is sometimes error-prone , so you can use wildcards to find and replace, adding spaces after punctuation. as follows:
A,x
A.X
A:X
We need to replace with something like this
A, x
A. X
A: X

wps steps

write picture description here
Enter the search and replace interface (the word replacement shortcut keys of WPS and Office are generally yes ctrl+h),

 1. 将查找内容填写为:([a-zA-Z])([,.:])([a-zA-Z]) 
 2. 替换为: \1\2 \3
 3. 勾选使用通配符
 4. 查找下一处(具体看看是否满足)
 5. 替换
 6. 重复步骤4-5
`([a-zA-Z])([,.:])([a-zA-Z])` has three `()`, so it represents three tuples, in this case each tuple in Only one character can be matched. \1\2\3, means to extract the characters matched by the tuple from the matched characters, \1 means to extract the first tuple `([a-zA-Z])` matched characters from the matched characters.

Other common wildcards are as follows

serial number

Clear the Use wildcards check box

Tick ​​the Use wildcards checkbox

Special characters

code

Special characters

code or wildcard

1

any single character

^?

any single character

?

2

any number

^#

any number (single)

[0-9]

3

any English letter

^$

any English letter

[a-zA-Z]

4

paragraph mark

^p

paragraph mark

^13

5

manual line break

^l

manual line break

^l or ^11

6

graphics

^g or ^1

graphics

^g

7

1/4 long dash

^+

1/4 long dash

^q

8

long dash

^j

long dash

^+

9

dash

^q

dash

^=

10

Tabs

^t

Tabs

^t

11

caret

^

caret

^^

12

column break

^v

column break

^n or ^14

13

section break

^b

Section breaks/page breaks

^m

14

ellipsis

^n

ellipsis

^i

15

Full-width abbreviation

^i

Full-width abbreviation

^j

16

no width non-separator

^ z

no width non-separator

^ z

17

no width optional delimiter

^x

no width optional delimiter

^x

18

non-breaking space

^s

non-breaking space

^s

19

nonstop hyphen

^~

nonstop hyphen

^~

20

¶Paragraph notation

^%

expression

( )

21

§ Section breaks

^

word ending

22

Footnote markers

^f or ^2

word start

23

optional hyphen

^-

any string

*

24

blank area

^w

Any single character outside the specified range

[!x-z]

25

Manual page breaks

^m

Any single character in the specified range

[ - ]

26

endnote markers

^e

1 or more previous characters or expressions

@

27

area

^d

n previous characters or expressions

{ n }

28

Unicode characters

^ Unnnn

more than n previous characters or expressions

{ n, }

29

full-width spaces

^u8195

n to m previous characters or expressions

{ n,m }

30

half-width space

^32 or ^u8194

All lowercase English letters

[a-z]

31

annotation

^a or ^5

all capital letters

[A-Z]

32

 

 

all western characters

[^1-^127]

33

 

 

All Chinese characters and Chinese punctuation

[!^1-^127]

34

 

 

All Chinese characters (CJK unified characters)

[一-羥] or [一-﨩]

35

 

 

All Chinese punctuation

[!一-龥^1-^127]

36

 

 

all non-numeric characters

[!0-9]

For basic wildcards in wod see this blog post
Word Find and Replace Wildcards (full version)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325428282&siteId=291194637