发布于 2016-05-05 08:07:38 | 194 次阅读 | 评论: 0 | 来源: 网友投递
这里有新鲜出炉的精品教程,程序狗速度看过来!
Notepad++编辑器
Notepad++ 是一款Windows环境下免费开源的代码编辑器,支持的语言:C, C++ , Java , C#, XML, HTML, PHP, Javascript!
待替换的文本:
<link rel="stylesheet" title="Default" href="styles/default.css">
<link rel="alternate stylesheet" title="Dark" href="styles/dark.css">
<link rel="alternate stylesheet" title="FAR" href="styles/far.css">
<link rel="alternate stylesheet" title="IDEA" href="styles/idea.css">
<link rel="alternate stylesheet" title="Sunburst" href="styles/sunburst.css">
<link rel="alternate stylesheet" title="Zenburn" href="styles/zenburn.css">
<link rel="alternate stylesheet" title="Visual Studio" href="styles/vs.css">
<link rel="alternate stylesheet" title="Ascetic" href="styles/ascetic.css">
<link rel="alternate stylesheet" title="Magula" href="styles/magula.css">
<link rel="alternate stylesheet" title="GitHub" href="styles/github.css">
<link rel="alternate stylesheet" title="Google Code" href="styles/googlecode.css">
<link rel="alternate stylesheet" title="Brown Paper" href="styles/brown_paper.css">
<link rel="alternate stylesheet" title="School Book" href="styles/school_book.css">
<link rel="alternate stylesheet" title="IR Black" href="styles/ir_black.css">
<link rel="alternate stylesheet" title="Solarized - Dark" href="styles/solarized_dark.css">
<link rel="alternate stylesheet" title="Solarized - Light" href="styles/solarized_light.css">
<link rel="alternate stylesheet" title="Arta" href="styles/arta.css">
<link rel="alternate stylesheet" title="Monokai" href="styles/monokai.css">
<link rel="alternate stylesheet" title="XCode" href="styles/xcode.css">
<link rel="alternate stylesheet" title="Pojoaque" href="styles/pojoaque.css">
<link rel="alternate stylesheet" title="Rainbow" href="styles/rainbow.css">
<link rel="alternate stylesheet" title="Tomorrow" href="styles/tomorrow.css">
<link rel="alternate stylesheet" title="Tomorrow Night" href="styles/tomorrow-night.css">
<link rel="alternate stylesheet" title="Tomorrow Night Bright" href="styles/tomorrow-night-bright.css">
<link rel="alternate stylesheet" title="Tomorrow Night Blue" href="styles/tomorrow-night-blue.css">
<link rel="alternate stylesheet" title="Tomorrow Night Eighties" href="styles/tomorrow-night-eighties.css">
想要的格式如下:
索引 = 内容
其中,索引为 href属性中的css文件名(不含扩展名),内容为 title属性。如果普通替换,可以得到内容 = 索引 格式的结果,可是剩下的就得手动替换了。
用正则表达式,一步就可以搞定,正则式为:
.+=\".+\".+=\"(.+)\".+=\"\w+\/(.+)[.].+
替换规则:
\2 = \1
替换后结果:
default = Default
dark = Dark
far = FAR
idea = IDEA
sunburst = Sunburst
zenburn = Zenburn
vs = Visual Studio
ascetic = Ascetic
magula = Magula
github = GitHub
googlecode = Google Code
brown_paper = Brown Paper
school_book = School Book
ir_black = IR Black
solarized_dark = Solarized - Dark
solarized_light = Solarized - Light
arta = Arta
monokai = Monokai
xcode = XCode
pojoaque = Pojoaque
rainbow = Rainbow
tomorrow = Tomorrow
tomorrow-night = Tomorrow Night
tomorrow-night-bright = Tomorrow Night Bright
tomorrow-night-blue = Tomorrow Night Blue
tomorrow-night-eighties = Tomorrow Night Eighties
来自:annhe.net