php 正则表达式怎么匹配标签里面的style?

$str = '<div style="margin:0px;text-align:left;padding:0px;">任意内容</div>';
$reg = '#<div style=".*">(.*)</div>#';
preg_match_all($reg , $str , $matches);
var_dump($matches);

https://zhidao.baidu.com/question/332235315308735045.html

原文地址:https://www.cnblogs.com/lxwphp/p/15454654.html