hash tags?
letsforum Offline
Junior Member
**
Posts: 36
Joined: Sep 2013
Post: #1
hash tags?
Hi could you help me please?

I am using this regular expression to match hash tags in the post:

Code:
/#([A-Za-z0-9]+)(?=\s|\Z)/


It works but of you add a special character to the end or inside the tag it stops working!

How to make this:

Code:
/#([\w]+)/i

not to grab font color #fff; or color from BBcode [font=#fff]

Code:
$post['message'] = preg_replace('/#([A-Za-z0-9\.\,\?]+)(?=\s|\Z)/', ' [url='.$mybb->settings['bburl'].'/hashtag/\1]#\1[/url]', $post['message']);


Internet marketing and SEO forum - http://letsforum.com
(This post was last modified: 08-20-2015 01:05 PM by letsforum.)
08-20-2015 01:03 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
hash tags? - letsforum - 08-20-2015 01:03 PM
RE: hash tags? - ZiNgA BuRgA - 09-01-2015, 04:52 PM

 Standard Tools
Forum Jump: