从html代码中提取数字的PHP正则表达式


PHP regular expression to extract number from html code

在一个html源代码中,有这样的片段:

of <span class="important">721,006</span>

我想提取号码721,006。可能有不止一个,所以我需要单词"of"才能得到真正的。

你能帮我吗?

我认为这是一个非常简单的正则表达式,因为您不添加任何额外的要求:

#<span class="important">([0-9,]+)</span>#

示例