安装插件 Replace Rules
设置插件
// settings.json
"replacerules.rules": {
"1_去除所有空格": {
"find": "[ \\t]",
"replace": "",
"isRegex": true
},
"2_去除所有空行": {
"find": "^\\s*\\n",
"replace": "",
"isRegex": true
},
"3_直角引号统一初始化": {
// 先把所有乱七八糟的单/双直角引号全部打碎,统一和英文双引一起处理
"find": "[『』「」]",
"replace": "\"",
"isRegex": true
},
"4_英文双引精准配对": {
// 核心修正:捕获每行内任意成对出现的双引号,强制规范为前“后”
"find": "\"([^\"]+?)\"",
"replace": "“$1”",
"isRegex": true
},
"5_英文单引精准配对": {
// 同理,精准捕获行内成对出现的单引号,规范为前‘后’
"find": "'([^']+?)'",
"replace": "‘$1’",
"isRegex": true
},
"6_智能修复单边漏网之鱼_左": {
// 针对文字左侧被误伤或落单的反引号,强行修正为左引号
"find": "”(?=[\\u4e00-\\u9fa5\\w])",
"replace": "“",
"isRegex": true
},
"7_智能修复单边漏网之鱼_右": {
// 针对文字右侧、或者紧跟在标点(如。,、?!)后面的左引号,强行修正为右引号
"find": "“(?=[。,、?!…])|(?<=[\\u4e00-\\u9fa5\\w])“",
"replace": "”",
"isRegex": true
},
"8_段首精准缩进2字符": {
"find": "^(?=\\S)",
"replace": " ",
"isRegex": true
},
"9_中文左引号替换英文引号": {
"find": "“",
"replace": "\"",
"isRegex": false
},
"10_中文右引号替换英文引号": {
"find": "”",
"replace": "\"",
"isRegex": false
},
"11_英文引号替换中文引号": {
"find": "\"(.*?)\"",
"replace": "“$1”",
"isRegex": true
},
"12_全角转半角": {
"find": [
// 全角大写字母 A-Z
"A","B","C","D","E","F","G","H","I","J","K","L","M",
"N","O","P","Q","R","S","T","U","V","W","X","Y","Z",
// 全角小写字母 a-z
"a","b","c","d","e","f","g","h","i","j","k","l","m",
"n","o","p","q","r","s","t","u","v","w","x","y","z",
// 全角数字 0-9
"0","1","2","3","4","5","6","7","8","9",
// 全角符号(对应 ASCII 可打印字符)
"!",""","#","$","%","&","'","(",")","*","+",",","-",".","/",
":",";","<","=",">","?","@",
"[","\","]","^","_","`",
"{","|","}","~",
// 全角空格
" "
],
"replace": [
// 半角大写
"A","B","C","D","E","F","G","H","I","J","K","L","M",
"N","O","P","Q","R","S","T","U","V","W","X","Y","Z",
// 半角小写
"a","b","c","d","e","f","g","h","i","j","k","l","m",
"n","o","p","q","r","s","t","u","v","w","x","y","z",
// 半角数字
"0","1","2","3","4","5","6","7","8","9",
// 半角符号
"!","\"","#","$","%","&","'","(",")","*","+",",","-",".","/",
":",";","<","=",">","?","@",
"[","\\","]","^","_","`",
"{","|","}","~",
// 半角空格
" "
]
}
},
"replacerules.rulesets": {
"全语境标点与文章一键净化": {
"rules": [
"1_去除所有空格",
"2_去除所有空行",
"3_直角引号统一初始化",
"4_英文双引精准配对",
"5_英文单引精准配对",
"6_智能修复单边漏网之鱼_左",
"7_智能修复单边漏网之鱼_右",
"8_段首精准缩进2字符",
"9_中文左引号替换英文引号",
"10_中文右引号替换英文引号",
"11_英文引号替换中文引号",
"12_全角转半角"
]
}
},