Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望 php 中的 RegEx 在我的 html 页面中找到 js 变量的值。像这样:
varName = "http://sample.com";
类似的东西......但是由于js代码的复杂性,它可能会变得非常复杂
<? $varname = "varName"; preg_match('/'.$varname.'\s*?=\s*?(.*)\s*?(;|$)/msU',$html,$matches); if(count($matches>1)) { print($matches[1]); } ?>