3v4l.org

run code in 300+ PHP versions simultaneously
<?php //get the first occurance which is |~hey~| $string = '|~hey~|~look~|~behind~|'; preg_match('!\|~(.*)~\|!', $string, $matched); var_dump($matched);

preferences:
24.31 ms | 405 KiB | 5 Q