为什么php正则表达式程序会崩溃

为什么php正则表达式程序会崩溃,php,regex,crash,expression,Php,Regex,Crash,Expression,这是密码 就像我写的代码一样,php程序崩溃了!但是当我换了房间 code“/([^正则表达式的问题是,除了一个之外,您在这里捕获了所有内容。 <?php //here is the string $str ="<style> .a{color: red;} .a{color: red;} .a{color: red;} .a{color: red;} .a{color: red;} .a{color: red;} .a{color: red

这是密码


就像我写的代码一样,php程序崩溃了!但是当我换了房间
code“/([^正则表达式的问题是,除了一个
之外,您在这里捕获了所有内容。
 <?php 
//here is the string
$str ="<style>
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
  .a{color: red;}
</style>";
$str=ycs($str);
function ycs($str){
    $str = preg_replace_callback("/<style>([^<])+<\/style>/is", function($matched){
      return "abc";
}, $str);
return $str;
}
echo $str;
?>
<style>([^<])+<\/style>
<style>([^<]+)<\/style>