Title
Example: There is a string ah real deal Safi @ Assad @ The unofficial Caesar's occurrence of the hair of the Fengfengguangguang sent scholar @abc
Match the fragment at the beginning of the @ with a space or a trailing end, hoping to get @ Assad at unofficial @ Fengfengguangguang @abc four results (should be in an array)
How do you write such a regular?
Reply to discussion (solution)
$s = ' ah real deal's Safi @ Assad at the occurrence of the unofficial Caesar's Fengfengguangguang sent by the scholar @abc ';p reg_match_all ('/@.+ (\s|$)/U ', $s, $m);p rint_r ($m [0]);
Thanks a lot....
is Preg_match_all () ..... I took Preg_match () for half a day
Why don't you read the manual?
PHP code?123$s= ' Ah Real deal's Safi @ Assad @ the occurrence of the unofficial Caesar's hair @ Fengfengguangguang sent scholar @abc ';p reg_match_all ('/@.+ (\s|$)/U ', $s, $m);p rint_r ($m [0]);
Is there a preg_replace_all () version of Preg_replace ()? Would you like to replace all these with links?
Preg_replace () could have been replaced many times, the function you said did not.