【发布时间】:2020-01-13 22:13:12
【问题描述】:
我这里有这个字符串:
-Node: song
--Tag: ItsyWitsySpider
---lyrics: The itsy witty spider climbed up the waterspout.
Down came the rain,
and washed the spider out
--Tag: BaBaBlackSheep
---lyrics: Baa, baa, black sheep, have you any wool?
Yes sir, yes sir, three bags full!
One for the master,
And one for the dame,
--Tag:IfYoureHappyAndYouKnowIt
...
我想得到所有的
The itsy witty spider climbed up the waterspout.
Down came the rain,
and washed the spider out
通过使用正则表达式 到目前为止,我最好的正则表达式是:
(?<=ItsyWitsySpider\n)(?:_*lyrics: ).*?(?=_)
在这里试穿:https://regex101.com/r/3myZwB/1 它似乎不起作用 感谢您的帮助
【问题讨论】:
标签: regex