简体   繁体   English

正则表达式提取歌词

[英]Regular expression to extract lyrics

'[03:22.00][03:55.00]Rain on me, rain, rain' I want to get the lyrics through regular expressions,I tried to get the characters after "]", but this is not correct. '[03:22.00][03:55.00]Rain on me, rain, rain'我想通过正则表达式获取歌词,我试图获取“]”之后的字符,但这不正确。

This regular expression should capture everything between the last closing bracket and the end of the string:此正则表达式应捕获最后一个右括号和字符串末尾之间的所有内容:

/([^\]]+$)/

'[03:55.00][05:44.22]Rain on me, rain, rain'.match(/([^\]]+$)/)

Replace is better here:替换在这里更好:

'[03:22.00][03:55.00]Rain on me, rain, rain'.replace(/.*\]/, '')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM