word通配符使用大全

2020/12/27 11:16

基本语法

Wildcard Purpose Example
? Any single character h?t will find hat, hot, and h t
* Any number of characters a*d will find ad, ahead, and as compared
[ ] One of these characters t[ai]n will find tan and tin, but not ton
[ – ] One of these characters in a range [b-d]ot will find bot, cot, and dot
[! ] Not the specific characters [!d]ust will find rust and must, but not dust
< The beginning of a word <(some) will find something, someone, and somewhere
> The end of a word (one)> will find stone, cone, and provolone
@ One or more instances of a character cor@al will find coral and corral
{n} Exactly n instances of a character ^p{2} will find two consecutive paragraph breaks
{n,} At least n instances of a character 10{2,} will find 100, 1000, and 10000
{n,m} Between n and m instances of a character 10{2,3} will find only 100 and 1000, not 10000

通配符/非通配符对照

序号 特殊字符(不使用通配符) 代码(不使用通配符) 特殊字符(使用通配符) 代码(使用通配符)
1 任意单个字符 ^? 任意单个字符 ?
2 任意数字 ^### 任意数字(单个) [0-9]
3 任意英文字母 ^$ 任意英文字母 [a-zA-Z]
4 段落标记 ^p 段落标记 ^13
5 手动换行符 ^l 手动换行符 ^l 或 ^11
6 图形 ^g 或 ^1 图形 ^g
7 1/4长划线 ^+ 1/4长划线 ^q
8 长划线 ^j 长划线 ^+
9 短划线 ^q 短划线 ^=
10 制表符 ^t 制表符 ^t
11 脱字号 ^ 脱字号 ^^
12 分栏符 ^v 分栏符 ^n 或 ^14
13 分节符 ^b 分节符/分页符 ^m
14 省略号 ^n 省略号 ^i
15 全角省略号 ^i 全角省略号 ^j
16 无宽非分隔符 ^z 无宽非分隔符 ^z
17 无宽可选分隔符 ^x 无宽可选分隔符 ^x
18 不间断空格 ^s 不间断空格 ^s
19 不间断连字符 ^~ 不间断连字符 ^~
20 ¶段落符号 ^% 表达式 ( )
21 §分节符 ^ 单词结尾 <
22 脚注标记 ^f 或 ^2 单词开头 >
23 可选连字符 ^- 任意字符串 *
24 空白区域 ^w 指定范围外任意单个字符 [!x-z]
25 手动分页符 ^m 指定范围内任意单个字符 [ – ]
26 尾注标记 ^e 1个以上前一字符 或 表达式 @
27 ^d n 个前一字符 或 表达式 { n }
28 Unicode 字符 ^Unnnn n个以上前一字符 或 表达式 { n, }
29 全角空格 ^u8195 n 到 m 个前一字符 或 表达式 { n,m }
30 半角空格 ^32 或 ^u8194 所有小写英文字母 [a-z]
31 批注 ^a 或 ^5 所有大写英文字母 [A-Z]
32 所有西文字符 [^1-^127]
33 所有中文汉字和中文标点 [!^1-^127]
34 所有中文汉字(CJK统一字符) [一-龥] 或 [一-﨩]
35 所有中文标点 [!一-龥^1-^127]
36 所有非数字字符 [!0-9]
37 要查找的表达式 \n \
38 段落标记↵ ^p 段落标记↵ ^p
39 手动换行符↓ ^l 手动换行符↓ ^l
40 查找的内容 ^& 查找的内容 ^&
41 剪贴板内容 ^c 剪贴板内容 ^c
42 省略号 ^i 省略号 ^i
43 全角省略号 ^j 全角省略号 ^j
44 制表符 ^t 制表符 ^t
45 长划线 ^+ 长划线 ^+
46 1/4长划线( — ) ^q 1/4长划线( — ) ^q
47 短划线( – ) ^= 短划线( – ) ^=
48 脱字号 ^^ 脱字号 ^^
49 手动分页符 ^m 或 ^12 手动分页符/分节符 ^m
50 可选连字符(_) ^- 可选连字符(_) ^-
51 不间断连字符(-) ^~ 不间断连字符(-) ^~
52 不间断空格 ^s 不间断空格 ^s
53 无宽非分隔符 ^z 无宽非分隔符 ^z
54 无宽可选分隔符 ^x 无宽可选分隔符 ^x
55 分栏符 ^n 分栏符 ^n
56 §分节符 ^% §分节符 ^%
57 ¶段落符号 ^v ¶段落符号 ^v

注:要查找已被定义为通配符的字符,该字符前反斜\ 。查找*()[ 、]等的代码分别是\?\*\(\)\[\]

通配符查找段尾

[^l^13]

 

发表回复

Back to top