3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $text= "#h #gg #مصر"; $get_hash = preg_match_all("/(^|\s)#(\w*[a-zA-Z-أ-إ-آ-ا-ب-ت-ث-ج-ح-خ-د-ذ-ر-ز-س-ش-ص-ض-ط-ظ-ع-غ-ف-ق-ك-ل-م-ن-ه-و-لا-لا-لآ-لأ-لإ-ى-ي-ئ-ة-ء-ؤ_]+\w*)/", $text, $matches); $array_hash = implode("",$matches[0]).""; $hash = str_replace('#', ', ', $array_hash); echo "hash (".$hash.")<br />"; echo $text;
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
hash (, h , gg , مصر)<br />#h #gg #مصر