3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $re = "/(?<=^\\S|\\s\\S|\\s)[RD]/g"; $str = "-D-K4_NNNN_M116_R1_001.gz _D-K4_NNNN_M56_R1_001.gz R-K4_NNNN_KQ9_R1_001.gz D-K4_NNNN_M987_R1_001.gz _R-K4_NNNN_M987_R1_001.gz"; preg_match_all($re, $str, $matches); echo '<pre>'; print_r($matches); echo '</pre>';
Output for 5.3.21 - 7.2.0
Warning: preg_match_all(): Unknown modifier 'g' in /in/hX1Un on line 6 <pre></pre>