2015-08-19, 04:29 PM
I am working on hash tags but I have an issue?
I am parsing message with this:
This works but stops when the hashtag contains special character!
I am using this expression:
It works great simply ignores the special characters but the problem is it also parses quotes, signature and codes.
How to make make this work?
I am parsing message with this:
$tweet = $message;
return preg_replace("/#([A-Za-z0-9_]+)(?=\s|\Z)/", '<a href="'.$mybb->settings['bburl'].'/hashtag/\1">#\1</a>', $tweet);
return $message;
This works but stops when the hashtag contains special character!
I am using this expression:
/#([\w]+)/i
It works great simply ignores the special characters but the problem is it also parses quotes, signature and codes.
How to make make this work?