0
我需要使用正则表达式来提取以下字符串的数字:PHP多位数的正则表达式
PC 32444的Xbox 43567
所以我的阵列将
array ([0] => 32444 [1] => 43567)
有人能帮助为我构建一个preg_match?
谢谢!
我需要使用正则表达式来提取以下字符串的数字:PHP多位数的正则表达式
PC 32444的Xbox 43567
所以我的阵列将
array ([0] => 32444 [1] => 43567)
有人能帮助为我构建一个preg_match?
谢谢!
试试这个正则表达式:
/\d+/
但是,你需要使用preg_match_all
来获取所有的比赛:
preg_match_all('/\\d+/', $str, $matches)
$matches[0]
则包含你正在寻找的阵列。