Languages
Appearance
这里主要记录适合单独开一个文件的小技巧。
设计笔记官方有一篇文章专门介绍正则表达式,可以参考这里。
这里相当于是一个补充,通过使用场景来介绍正则表达式的使用。
1. 匹配 MD 中的标题
比如我想匹配## Title这样的标题,直接搜索## 也会匹配到### Title,这个时候就可以用正则来匹配,在搜索替换中输入下面命令就可以排除掉 H3 的标题:
## Title
##
### Title
(?<!#)##\s
(?<!#): 表示不匹配#,即##前面不能有#。
(?<!#)
#
\s: 表示空格。
\s