如何通过正则表达式获取cdata中的所有值?

时间:2014-12-01 09:05:55

标签: regex html-parsing

[CDATA[The presence of proteins can be detected by the Biuret test.<br/>
                            (i) Crush the food sample and put some of it into a clean test tube. Add some
                            sodium hydroxide solution.<br/>
                            (ii) Cork the test tube and shake it to mix the food with the sodium hydroxide
                            solution. Then add a little copper sulphate solution. Cork and shake it
                            again.<br/>If the solution turns blue, there is no protein in the food. But it turns violet, there is protein in the food.]]

1 个答案:

答案 0 :(得分:0)

\[[^\[\]]*?\]

试试这个。看看演示。

http://regex101.com/r/sA8iT4/4