PHP Regex - Finding multiple word start with # like '#ball' -


this question has answer here:

i trying create php regex match if word start '#' '#ball'. have tried

preg_match_all('/( #\w+)/u', $text, $matches); 

but returns words containing '#' 'pin#ball'.

try this:

$sdata = '#pin all#foo #bar'; preg_match_all('/(^|\s+)#([a-za-z]+)/', $sdata , $rgmatches); //var_dump($rgmatches[2]); 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -