标签: php match
这发生在多个地方,但这是一个例子。我正试图从/etc/resolv.conf
/etc/resolv.conf
nameserver 1.1.1.1 nameserver 2.2.2.2
这是我的正则表达式,它仅适用于第一场比赛。为什么我不能匹配所有名称服务器?我的$match数组只有ne值。
$match
preg_match('/nameserver ([^\s]+)/', $fileContents, $match);
感谢阅读。