<?php $re = '~\B(?<!@)@([0-9a-z]+)(?:\s|$)~ui'; $str = "@ww@ee x@@vx @ss @aa assadd @sfsd"; preg_match_all($re, $str, $matches);print_r($matches);
Standard input is empty
Array ( [0] => Array ( [0] => @ss [1] => @aa [2] => @sfsd ) [1] => Array ( [0] => ss [1] => aa [2] => sfsd ) )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!