
July 31st, 2011, 09:37 PM
|
|
Registered User
|
|
Join Date: Jul 2011
Posts: 16
Time spent in forums: 3 h 28 m 33 sec
Reputation Power: 0
|
|
|
PHP - Need help targeting words starting with @ and no spaces/periods/commas after
Hi I've used regex briefly in the past, not very often or complicated. I need help targeting words starting with @ and no spaces/periods/commas after
I'm using preg_match_all to get all of these items but i believe my regex expression is the issue.
So the string: "@hello devshed @hi"
should only return in an array hello and hi.
This is what i have now:
Code:
preg_match_all('/(@)(.*)[^\S]/', $string, $matches, PREG_SET_ORDER);
Thanks!!
|