lrc歌词 正则表达式删除时间标尺

来源:百度知道 编辑:UC知道 时间:2024/05/30 15:15:33
[00:04.14]歌名:Living To Love You
[00:08.51]歌手:Sarah Connor
[00:11.78]专辑:Naughty But Nice
[00:20.00]All we had was just one summer
[00:26.67]Two lovers strolling in the park
[00:33.63]But like they say the world keeps turning
[00:39.44]As the leaves would’ve fallen we should fall apart

如何使用正则表达式删除时间标尺,即[00:39.44]、[00:08.51]这个东西
用UltraEdit的正则表达式怎么弄。
1、2、3、楼的回答试验了,只有2楼的列模式有曲线达到效果,不过我想要的是正则表达式 感谢大家了

UE的正则支持三种语法:UltraEdit, Unix 和 Perl.

但是缺省的UltraEdit语法支持不了复杂的表达式。需要在Advanced->Configuration(高级->配置)菜单,选择Search(搜索),然后选择Perl语法。

然后再使用\[\d\d:\d\d\.\d\d\]匹配就可以了。

另外推荐N种更简单的方法:

1. 你可以在UE中按Alt-C切换到列模式,用鼠标选中左边的几列字符删除就可以了。

2. 推荐用Replace Pioneer,支持标准正则表达式,步骤:
1) ctrl-o打开txt文件
2) ctrl-h打开替换窗口
在Search for Pattern输入\[.*?\]然后点击Replace即可完成。

3. 在Replace Pioneer里删除前10列:
1) ctrl-o打开txt文件
2) ctrl-h打开替换窗口
* Replace Unit选择Chars
* Replace Scope选择Line
* Unit Number Filter填1..10
* 然后点击Replace即可完成。

4. 用Replace Pioneer的列模式:
ctrl-o打开文件后,按住ctrl然后用鼠标选中前几列,删除,ok!

@echo off
(for /f "tokens=2 delims=]" %%i in (a.txt) do echo %%i)>#a.txt
start #a.txt
::另存为a.bat

(?<=\[.*\]).*

用这个正则表达式一提取就行了,很简单

\[\d\d:\d\d.\d\d\]