【发布时间】:2011-09-02 12:09:02
【问题描述】:
我有一个大字符串,其中包含多个数学。想把它们全部取出一个字符串数组。使用正则表达式找到它们。但是正则表达式中缺少一些东西,所以它没有给出任何输出。
MathMls 的正则表达式是什么?
示例字符串
求和 «math xmlns=\"http://www.w3.org/1998/Math/MathML\"»«mroot»«mrow»«mi»#«/mi »«mi»a«/mi»«/mrow»«mn»3«/mn»«/mroot»«mo»=«/mo»«mroot»«mrow»«mi»#«/mi»«mi» b«/mi»«/mrow»«mn»3«/mn»«/mroot»«/math» 和 «math xmlns=\"http://www.w3.org/1998 /Math/MathML\"»«mo»=«/mo»«msup»«mfenced»«mrow»«mi»#«/mi»«mi»b«/mi»«/mrow»«/mfenced»«mfrac »«mn»1«/mn»«mn»3«/mn»«/mfrac»«/msup»«/math»
从这里得到 2 个 mathmls
【问题讨论】: