3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $subject = "Ik ben #Nicky# ik werk bij de #McDonalds# en ik bak daar de #kip nuggets# en de #kip burgers# en morgen heb ik een #training#."; $match = preg_match_all('/#+([a-zA-Z0-9 ])+#/', $subject, $matches, PREG_PATTERN_ORDER); echo '<pre>'; print_r($matches[0]); echo '</pre>'; ?>
based on kuLmD
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<pre>Array ( [0] => #Nicky# [1] => #McDonalds# [2] => #kip nuggets# [3] => #kip burgers# [4] => #training# ) </pre>