符号 | 解释 |
---|---|
\s | 匹配空格. 注意,会匹配标记的末尾. 使用 [[:blank:]] 来避免匹配新一行。 |
\S | 匹配非空白 |
\w | 匹配单词字符 |
\W | 匹配非单词字符 |
\d | 匹配数字字符 |
\D | 匹配非数字字符 |
\b | 匹配单词边界. ‘\bW\w+’ 找到W开头的单词 |
\B | 匹配非单词边界. ‘\Be\B+’ ?C 找到位于单子中间的字母’e’ |
\< | This matches the start of a word using Scintilla’s definitions of words. |
> | This matches the end of a word using Scintilla’s definition of words. |
\x | 运行用x来表达可能具有其他意思的字符。例如, [ 用来插入到文本中作为[ 而不是作为字符集的开始. |
4 、字符类
符号 | 解释 |
---|---|
[[:alpha:]] | 匹配字母字符: [A-Za-z] |
[[:digit:]] | 匹配数字字符: [0-9] |
[[:xdigit:]] | 匹配16进制字符: [0-9A-Fa-f] |
[[:alnum:]] | 匹配字母数字字符: [0-9A-Za-z] |
[[:lower:]] | 匹配小写字符: [a-z] |
[[:upper:]] | 匹配大写字符: [A-Z] |
[[:blank:]] | 匹配空白 (空格 or tab):[ \t] |
[[:space:]] | 匹配空白字符:[ \t\r\n\v\f] |
[[:punct:]] | 匹配标点字符: [-!”#$%&’()*+,./:;<=>?@[]_`{ |
[[:graph:]] | 匹配图形字符: [\x21-\x7E] |
[[:print:]] | 匹配可打印的字符 (graphical characters and spaces) |
[[:cntrl:]] | 匹配控制字符 |
5 、替换操作
Text body | Search string | Replace string | Result |
---|---|---|---|
Hi my name is Fred | my name is (.+) | my name is not \1 | Hi my name is not Fred |
The quick brown fox jumped over the fat lazy dog | brown (.+) jumped over the (.+) | brown \2 jumped over the \1 | The quick brown fat jumped over the fox lazy dog |
以上就是notepad怎么模糊替换的详细内容,更多文章请关注木庄网络博客!
相关阅读 >>
更多相关阅读请进入《Notepad》频道 >>