3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/\s-\s\d\.\d\sMB/'; // example match " - 4.0 MB" $str = '<a href="http://example.com/a0j8nm5l3wo0" target=_blank>01 song name.mp3 - 2.4 MB</a> <a href="http://example.com/ic1jfhhzzfth" target=_blank>02 song name.mp3 - 4.0 MB</a> <a href="http://example.com/zo2nv6bzy6gd" target=_blank>03 song_name.mp3 - 3.3 MB</a> <a href="http://example.com/5fyony1m4j0w" target=_blank>04 song name.mp3 - 3.5 MB</a> <a href="http://example.com/3imswet27clg" target=_blank>05 song name.mp3 - 1.9 MB</a> <a href="http://example.com/ml65j3gpdggv" target=_blank>06 song - name.mp3 - 3.4 MB</a> <a href="http://example.com/hmuk8il0a04j" target=_blank>07 song name.mp3 - 4.4 MB</a> <a href="http://example.com/qx81e67ystd3" target=_blank>08 song-name.mp3 - 3.9 MB</a> <a href="http://example.com/g6fo1s64vzkj" target=_blank>09 song name.mp3 - 3.9 MB</a> <a href="http://example.com/xo3hw4xyx372" target=_blank>10 song name.mp3 - 3.6 MB</a> <a href="http://example.com/ivcth22eqygd" target=_blank>11 song-name.mp3 - 3.3 MB</a>'; $subst = ''; $result = preg_replace($re, $subst, $str); echo $result;
Output for 7.0.0 - 7.0.23, 7.1.0 - 7.1.20, 7.2.6 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14
<a href="http://example.com/a0j8nm5l3wo0" target=_blank>01 song name.mp3</a> <a href="http://example.com/ic1jfhhzzfth" target=_blank>02 song name.mp3</a> <a href="http://example.com/zo2nv6bzy6gd" target=_blank>03 song_name.mp3</a> <a href="http://example.com/5fyony1m4j0w" target=_blank>04 song name.mp3</a> <a href="http://example.com/3imswet27clg" target=_blank>05 song name.mp3</a> <a href="http://example.com/ml65j3gpdggv" target=_blank>06 song - name.mp3</a> <a href="http://example.com/hmuk8il0a04j" target=_blank>07 song name.mp3</a> <a href="http://example.com/qx81e67ystd3" target=_blank>08 song-name.mp3</a> <a href="http://example.com/g6fo1s64vzkj" target=_blank>09 song name.mp3</a> <a href="http://example.com/xo3hw4xyx372" target=_blank>10 song name.mp3</a> <a href="http://example.com/ivcth22eqygd" target=_blank>11 song-name.mp3</a>

preferences:
167.17 ms | 410 KiB | 5 Q