兄弟 不懂就要问啊 这是很好的 这答案我也是自己理解加上问朋友的的
$s='*/1 * * * * /user/data/bbbccc 172.16.1.91 >>/sys/data/aaaaa.log &-1
*/1 * * * * /user/data/bbbccc 172.16.2.91 >>/sys/data/aaaaa.log &-1
*/1 * * * * /usgzxioner/data/bbbccc 172.16.3.91 >>/sys/data/aaaaa.log &-1
*/1 * * * * /user/data/bbbcacc 172.16.4.91 >>/sys/data/aaaaa.log &-1
*/1 * * * * /user/dataasdasbbccc 172.16.5.91 >>/sys/data/aaaaa.log &-1
*/1 * * * * /user/datribbccc 172.16.5.91 >>/sys/data/aaaaa.log &-1
*/1 * * * * /user/data/怪bbbccc 172.16.1.91 >>/sys/data/aaaaa.log &-1
*/1 * * * * /user/data/bbbccc 172.16.1.91 >>/sys/data/aaaaa.log &-1
';
preg_match_all('/\d+.\d+.\d+.\d+/', $s, $m);
var_dump($m);
==========
输出:
array
0 =>
array
0 => string '172.16.1.91' (length=11)
1 => string '172.16.2.91' (length=11)
2 => string '172.16.3.91' (length=11)
3 => string '172.16.4.91' (length=11)
4 => string '172.16.5.91' (length=11)
5 => string '172.16.5.91' (length=11)
6 => string '172.16.1.91' (length=11)
7 => string '172.16.1.91' (length=11) |