正则表达式之处理一组lrc听力文件后续
文章目录
此前写过这篇:正则表达式之处理一组lrc听力文件
室友近期在学Python,觉得上篇用的方法不够直观,理解起来有些费力,希望看到一个用正则找到文本之后进行替换的demo~ 作为中国好室友,我当然要给出demo啦
需求描述为:将时间格式改为以秒为单位。eg:[01:11.36]=>[71.36]
#待处理文本
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
:::text [00:00.12]section 2. [00:02.68]you will part of a radio programme about the opening of a new local sports shop. [00:09.32]first you have some time to look at questions 11 to 16. [00:39.64]now listen carefully and answer questions 11 to 16. [00:48.24]now we go to Jane who is going to tell us about what's happening in town this weekend. [00:52.24]right,thanks Andrew, [00:53.92]and now on to what's new, [00:56.48]and do we really need yet another sports shop in Bradcaster? [01:01.24]well,most of you probably know Sports World- [01:04.44]the branch of a Danish sports goods company that opened a few years ago- [01:09.04]it's attracted a lot of custom, [01:11.36]and so the company has now decided to open another branch in the area. [01:16.60]it's going to be in the shopping centre to the west of Bradcaster, [01:20.44]so that will be good news for all of you who've found the original shop in the north of the town hard to get to. [01:27.12]i was invited to a special preview [01:29.60]and i can promise you,this is the ultimate in sports retailing. ...... |
#解决方案
|
|
文章作者 种瓜
上次更新 2015-06-12