So, I'm trying to include hashtag search in posts in my application. I came up with some close regular expressions, but none of them work. Let's say I have a line:
#i keep #hashtags in my mom's attic. She says I am her number #1 son. Why I'm not num#ber #2: http:
I would like RegEx to match:
I want it to not specifically match the HTML objects, #anchors in the URLs, hashtags that start in the middle of the word, and any final punctuation after the hashtag. I also want to make sure that it matches the hashtag at the beginning of the line, as well as the hashtags that are fully numeric. I want him to make hyphens and underscores in hashtags. This is for a MySQL query, so Lookaheads and Lookbacks will not work.
Currently I'm stuck:
. RegEx - , . !