应该如何修改呢?复制代码
- #!/usr/bin/python
- # -*- coding: UTF-8 -*-
- import re
- str = '''TITLE "Leslie Cheung 张国荣 LPCD45"
- PERFORMER "张国荣"
- REM DATE "2008"
- REM DISCID E3103E10
- FILE "Leslie Cheung 张国荣 LPCD45.flac" WAVE
- TRACK 01 AUDIO
- TITLE "奔向未来日子"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 01 00:00:00
- TRACK 02 AUDIO
- TITLE "由零开始"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 04:29:50
- INDEX 01 04:34:50
- TRACK 03 AUDIO
- TITLE "这是爱"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 08:41:70
- INDEX 01 08:46:70
- TRACK 04 AUDIO
- TITLE "似水流年"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 12:28:42
- INDEX 01 12:33:42
- TRACK 05 AUDIO
- TITLE "情难自控"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 16:50:17
- INDEX 01 16:55:17
- TRACK 06 AUDIO
- TITLE "你在何地"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 21:09:35
- INDEX 01 21:14:35
- TRACK 07 AUDIO
- TITLE "烈火灯蛾"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 26:16:41
- INDEX 01 26:21:41
- TRACK 08 AUDIO
- TITLE "浓情"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 30:37:65
- INDEX 01 30:42:65
- TRACK 09 AUDIO
- TITLE "想你"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 34:16:59
- INDEX 01 34:21:59
- TRACK 10 AUDIO
- TITLE "雪中情"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 39:16:50
- INDEX 01 39:21:50
- TRACK 11 AUDIO
- TITLE "风再起时"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 43:22:08
- INDEX 01 43:27:08
- TRACK 12 AUDIO
- TITLE "沉默是金"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 47:55:56
- INDEX 01 48:00:56
- TRACK 13 AUDIO
- TITLE "共同渡过"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 52:07:62
- INDEX 01 52:12:62
- TRACK 14 AUDIO
- TITLE "寂寞夜晚"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 56:35:65
- INDEX 01 56:40:65
- TRACK 15 AUDIO
- TITLE "无需要太多"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 61:05:07
- INDEX 01 61:10:07
- TRACK 16 AUDIO
- TITLE "倩女幽魂"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 65:36:17
- INDEX 01 65:41:16'''
- print re.sub(r'REM COMMENT "[www.pt80.net]"','',str);
我只能说是能力问题。。。复制代码
- #!/usr/bin/python
- # -*- coding: UTF-8 -*-
- import re
- str = '''TITLE "Leslie Cheung 张国荣 LPCD45"
- PERFORMER "张国荣"
- REM DATE "2008"
- REM DISCID E3103E10
- FILE "Leslie Cheung 张国荣 LPCD45.flac" WAVE
- TRACK 01 AUDIO
- TITLE "奔向未来日子"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 01 00:00:00
- TRACK 02 AUDIO
- TITLE "由零开始"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 04:29:50
- INDEX 01 04:34:50
- TRACK 03 AUDIO
- TITLE "这是爱"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 08:41:70
- INDEX 01 08:46:70
- TRACK 04 AUDIO
- TITLE "似水流年"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 12:28:42
- INDEX 01 12:33:42
- TRACK 05 AUDIO
- TITLE "情难自控"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 16:50:17
- INDEX 01 16:55:17
- TRACK 06 AUDIO
- TITLE "你在何地"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 21:09:35
- INDEX 01 21:14:35
- TRACK 07 AUDIO
- TITLE "烈火灯蛾"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 26:16:41
- INDEX 01 26:21:41
- TRACK 08 AUDIO
- TITLE "浓情"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 30:37:65
- INDEX 01 30:42:65
- TRACK 09 AUDIO
- TITLE "想你"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 34:16:59
- INDEX 01 34:21:59
- TRACK 10 AUDIO
- TITLE "雪中情"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 39:16:50
- INDEX 01 39:21:50
- TRACK 11 AUDIO
- TITLE "风再起时"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 43:22:08
- INDEX 01 43:27:08
- TRACK 12 AUDIO
- TITLE "沉默是金"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 47:55:56
- INDEX 01 48:00:56
- TRACK 13 AUDIO
- TITLE "共同渡过"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 52:07:62
- INDEX 01 52:12:62
- TRACK 14 AUDIO
- TITLE "寂寞夜晚"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 56:35:65
- INDEX 01 56:40:65
- TRACK 15 AUDIO
- TITLE "无需要太多"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 61:05:07
- INDEX 01 61:10:07
- TRACK 16 AUDIO
- TITLE "倩女幽魂"
- PERFORMER "张国荣"
- REM COMMENT "[www.pt80.net]"
- INDEX 00 65:36:17
- INDEX 01 65:41:16'''
- print re.sub('\n REM COMMENT "\[www.pt80.net\]"','',str)
欢迎光临 批处理之家 (http://bbs.bathome.net/) | Powered by Discuz! 7.2 |