3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $test=array("abcd/abcd_.mp3", "abcd", "asdasd/abcd.mp3", "abcd.", "blahahbasdabcd"); foreach ($test as $t) echo "$t =>" . preg_replace("/abcd([^_\.]*)/", "XXXXX" . "\${1}", $t) . "\n";
Output for 4.3.0 - 7.1.0
abcd/abcd_.mp3 =>XXXXX/abcd_.mp3 abcd =>XXXXX asdasd/abcd.mp3 =>asdasd/XXXXX.mp3 abcd. =>XXXXX. blahahbasdabcd =>blahahbasdXXXXX