鑑於以下文字,您將使用什麼PCRE正則表達式來提取以粗體標記的零件?多行,多變貪婪,正則表達式
00:20314 lorem ipsum want this kryptonite 00:02314 quux padding dont want this 00:03124 foo neither this 00:01324 foo but we want this stalagmite 00:02134 tralala not this 00:03124 bar foo and we want this kryptonite but not this(!) 00:02134 foo bar and not this either 00:dolor sit amet EOF
督察,我們想抽取開始,在正則表達式方面的部分,用「^ 0」和結束「(氪石|石筍)」。
一直在嘲笑這一點,發現它是一個難題。 TIA!
有幾種方法可以做到這一點。分隔符可以放在身體中嗎? – sln 2014-09-26 20:08:02
分隔這個唯一的東西不需要其他的'^ 0'在身體。 – sln 2014-09-26 20:28:45