Merge pull request #137 from Skehmatics/fix/apostrophe-bug

(Lazily) fix #131 by ignoring hashtags that begin with a ampersand in lexer
This commit is contained in:
daniel 2018-06-04 22:13:40 -06:00 committed by GitHub
commit 16f4d52476
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,7 +7,7 @@ class Hashtag {
public static function getHashtags($status)
{
$hashtags = false;
preg_match_all("/(#\w+)/u", $status, $matches);
preg_match_all("/(?<!&)(#\w+)/u", $status, $matches);
if ($matches) {
$res = array_count_values($matches[0]);
$hashtags = array_keys($res);