I want to find (if they exist) any hash tags and get the first co-occurrence of each tag plus the text after it but before the next tag if another exists.
*Not all message strings carry a hash tag!
Here is what I am trying to do:
List of possible string examples sent to script:
1) $message = 'Added some new stuff';
2) $message = '#BALANCE balanced movement of X';
3) $message = '#CHANGE some log text #FIX some other log text';
$num = prereg_match_all('@?????@', $message, $matches);
This is the array structure result I am aiming for from the matches:
Result of Example 1)
(
[0] => Array
(
[0] => Added some new stuff
)
)
Result of Example 2)
(
[0] => Array
(
[0] => balanced movement of X
[1] => #BALANCE
)
)
Result of Example 3)
(
[0] => Array
(
[0] => some log text
[1] => #CHANGE
)
[1] => Array
(
[0] => some other log text
[1] => #FIX
)
)
Things driving me nuts trying to find decent documentation on REGEX