3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $tweet = "hello world #dontremoveme foobar http://example.com/#dontremoveme #remove #removeme #removeüäüö"; #$res = preg_replace("/ #\p{L}+\b(?!\s+\p{L})/u", '', $tweet); $res = preg_replace("/ #\w+/u", '', $tweet); echo $res,"\n";
based on XrRLq
Output for 5.3.4 - 7.2.0
hello world foobar http://example.com/#dontremoveme
Output for 4.3.0 - 5.3.3
hello world foobar http://example.com/#dontremovemeüäüö