I have a web app which is creating and linking to #hashtags and I have noticed that if someone creates a #hashtag of #JB22 that the following code breaks.
Is there away in the regex I can allow numbers at the end of a #hashtag
$users = preg_replace("~(<var data-type=\"user\" class=\"userHighlight\" id=\"(.*?)\">)(.*?)(</var>)~", "<_link>$2|$3</_link> ", $start);
$tags = preg_replace("~(<var data-type=\"tag\" class=\"tagHighlight\" id=\"(.*?)\">)#(.*?)(</var>)~", "<_link>tag://$3|#$3</_link> ", $users);
$last = preg_replace("~(^|\\s)#(\\w*[a-zA-Z_]+\\w*)~", " <_link>tag://$2|#$2</_link> ", $tags);