3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $reg_exp = "/(^<table.+.(?:[n])?(?:.+)?)(<tbody>)/s"; $replace_with = '/1<thead>'; $input = '<table class="table table-bordered table-responsive" style="width: 100%;"> <tbody>'; $final = preg_replace($reg_exp, $replace_with, $input); var_dump($final);
based on EXLYV
Output for 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.30 - 7.3.0rc3
string(9) "/1<thead>"