In your regex there is a space before the # $mh_regex = "/\ #[a-zA-Z0-9-]+/";
so it would match # tag
instead of #tag
.
It might be a good idea to test your regex using this online tool: http://www.regexr.com/ it’s really usefull for testing
Related Posts:
- Edit tag cloud widget number
- How to automatically apply woocommerce product title to all product images alt tags?
- remove tags from posts in php
- Display user’s total comment count outside The Loop
- Facebook Comment Count
- Getting the comment number relative to all the post’s comments
- How to output a permanently delete comment link?
- count number of user comments with a specific comment meta value
- tag search using WP_Query
- Change comments form title on a page by page basis
- show limited tags in an article
- How do I make wordpress comment fields required?
- How do I create comment-reply-button using element not
- display most popular tags in two columns
- How to check if comments are paginated?
- How to add a post or page tag to the list of classes appearing in the body tag’s class attribute?
- Displaying Only Certain Tags in Loop
- query if on page/2/?
- Notify WordPress Site I Have Linked To Them
- Add “last” and “first” to WordPress Comment Pagination Links
- Uncaught TypeError: Cannot read property ‘firstChild’ of null after upgrading to WordPress 5.5
- Replace comment avatars and links at the same time
- Automatically generate Post/Page from searched Database item?
- Highlight Current Tag in wp_tag_cloud
- Adding ads code between comments
- Add relevant tag to search results
- Must Use Plugin Causing Query Error
- How do I fetch all comments per post via WP REST API?
- comments_number display outside specified span
- How to create a linked tag list in my sidebar
- Trying to implement Ajax comments in WordPress, getting WP error
- How does this WordPress Plugin (Thrive Comments) apply their custom comment sort? [closed]
- Adding country tags automatically
- Show comments menu in dashboard only if the site has comment
- Way to querry data (tags) from a wordpress database?
- “comments.php” not available after edit in WP administration
- User’s total comment count excluding comments on their own posts
- Sending data from custom inputs in WordPress comment form in the admin notification email
- Show wp_die if url form comment not emply
- Why does my callback function not work with this custom filter hook?
- Customize Theme comment template to Insert VoteUp and VoteDown buttons
- How to implement a rating and review system for WordPress custom posts?
- Ajax load more button for comments wordpress
- edit_comment_link is not showing for comment author
- Limit 1 global comment per minute
- Create Page To Count Comments For Each Post In WordPress Site
- Adding Taxonomy Image to taxonomy loop [closed]
- comments sorting incorrectly across multiple pages
- Commenting out unwated CSS/scripts in HTML with PHP
- wp-comments-post.php file returns a blank page
- php function to display commenter username or login
- Genesis framework comments broken?
- check if comment submitted was successful
- If tag equals then show else show
- Way to bulk make all my tags lowercase?
- Pull Tags But Not as Links
- Adding Meta Tags to a Post using its Tags, Excerpt and content
- How to add delete, approve, spam Links to Comments
- View tag description on page
- Real time notification on user profile after new comment
- What’s the correct offset value for order ASC?
- Display tag links on archive page?
- Using Tag Groups: Displaying groups and adjacent tags of current post
- How can I output the slug of a comment author?
- Show content by using tags
- How to associate dynamic PHP page for chosen WordPress tag?
- How can I enqueue comment-reply script only on certain page?
- Get a list of tags present in a paged front page
- How do you change the tag font size in the repeater-template.php [closed]
- PHP tag in post content makes wordpress go crazy
- Add Alt attribute to image served with php
- Notify admin (by email) if post added with specific tag
- Display product attributes for current product
- How to only fetch certain Tag ID’s
- Getting most popular posts based on Facebook comments count
- Insert wordpress tags below posts via functions.php
- Using tag to output text in Genesis?
- Is there a way to randomize and connect a background and header image?
- WordPress – show number of comments for each post in widget
- WordPress – show all posts + ones with specific tag
- How does add_action ‘comment_post’ work?
- Custom action on comment post
- WordPress most commented posts of last X days
- How do I call comments_template(); from a plugin file?
- Php echo into tag
- How to get the rating value of each comment
- Trouble figuring out how to get my button to submit comment
- How to convert my comment.html to comment.php
- Change background image based on tags
- Exclude specific product tags from related products in WooCommerce 3+ [closed]
- how to loop through blog posts in php
- The search doesn’t work properly
- Guests comment form – prevent duplicate email addresses
- Permissions error when I use my plugin to delete comments in the front-end
- Pre_get_comments and orderby comment_karma
- Count post with tags within one category?
- Getting checkboxes for some tags in a search box
- How to change product title color in shop page if product has specific product tag (Woocommerce)?
- Remove links to the comments section
- Removing website URL in comments causes misalignment of submit button and tickbox