How to identify #hashtag and "http://" link from a string in android

twitter hashtag analytics
hashtag optimization
how to use hashtags effectively
hashtag search
twitter hashtag trends
hashtag strength

is it possible to find a #hashtag and an "http://" link from a string and color it ? I am using this in Android.

public void setTitle(String title) {
    this.title = title;

Thanks in Advance

I have found an answer and here is the way to do it :

        SpannableString hashtagintitle = new SpannableString(imageAndTexts1.get(position).getTitle());
        Matcher matcher = Pattern.compile("#([A-Za-z0-9_-]+)").matcher(hashtagintitle);
        while (matcher.find())
            hashtagintitle.setSpan(new ForegroundColorSpan(Color.BLUE), matcher.start(), matcher.end(), 0);


How to Find Popular Twitter Hashtags, Once you know exactly what hashtags are, the next challenge is to find the best and most popular trending Twitter hashtags to incorporate into your tweets. You can use Linkify class to do more than hashtag and webpages. Here is an example on how you can find hashtags in textview and link it to another activity. share | improve this answer

this code below for COMPOUND WORD

public static List<String> getHashTags(String str) {
        Pattern MY_PATTERN = Pattern.compile("(#[a-zA-Z0-9ğüşöçıİĞÜŞÖÇ]{2,50}\\b)");
        Matcher mat = MY_PATTERN.matcher(str);
        List<String> strs = new ArrayList<>();
        while (mat.find()) {
        return strs;

Result is #hashtag , #hashtag2 , #hashtag3

Search Instagram Hashtags & Users (FREE) 🤗 Get Popular Tags, What is a hashtag and how do you use it? It is a word or a phrase use to identify a message on a specific topic that comes before a hash sign. If promoted by enough individuals, can “trend” and attract more individual users to the discussion. When hashtag started? #hashtag started way back in 23rd of August 2007 first used in a tweet by a former Google developer, Chris Messina.

This function will return a list of all the #hashtags in your string

public static List<String> getHashTags(String str) {
    Pattern MY_PATTERN = Pattern.compile("#(\\S+)");
    Matcher mat = MY_PATTERN.matcher(str);
    List<String> strs = new ArrayList<>();
    while (mat.find()) {
    return strs;

How to Use Hashtags on Twitter, Facebook & Instagram, anywhere in your social media posts: in the beginning, at the end, or anywhere in between. HashtagSet is the best hashtag app designed specifically to simplify the process of identifying and leveraging hashtags to grow your Instagram account. FIND HASHTAGS Enter any hashtag and get in-depth results of related hashtags that you can use immediately in posts.

You can use Linkify class to do more than hashtag and webpages. Here is an example on how you can find hashtags in textview and link it to another activity.

Hashtag Analytics 101: Using the Best Hashtags for Your Social , Hashtag analytics are essential to brands' social strategy. Find out how to use and track them for your campaigns. Use the hashtag #coffeeshots for photos of your coffee. Travel and Life. Use the hashtag #travelandlife on travel photography. The Glitter Guide. Use the hashtag #flashesofdelight on any pretty, pastel and feminine type photos. Huffington Post Weddings. Use the hashtag #HuffPostIDo to wedding photos. Wake Up and Make Up

You could match it using a regex.

Heres the Class in Android for using Regexes.

I quickly found this writeup on matching hashtags

And here's a SO question for matching URL's.

Hashtagify: Find and Analyse Top Twitter and Instagram Hashtags, how to find hashtags that will work best for your brand; why using only popular hashtags isn't the right approach; essential tips for using hashtags  At this stage, do not be too concerned about these two factors. As long as it the hashtag is logically related to your niche, include it in your latest hashtag list. 3. Gauge the Relevance of Your Hashtags. Finally, I visit Rite Tag created by Saul Fleischman. Under “Associated Hashtags”, I enter the hashtags that I had collected earlier.

How to Use Hashtags: A Quick and Simple Guide for Every Network, Everything you need to know about Instagram hashtags in 2020. What are Instagram hashtags? A hashtag is a combination of letters, numbers,  If you're new to social media, you might not know what the all-important hashtag is. Here, you can find out what "hashtag" means and how you use these very important tools to help people find your posts. Additionally, you can use them to find posts that you are interested in reading.

The 2020 Instagram Hashtag Guide—How to Use Them and Get , When you use relevant hashtags (#) in your social media posts, people who are searching for those keywords can find your tweets and posts, and  On Instagram, the related hashtags show just above the “Top” and “Recent” tabs when in the Explore section of Instagram. On LinkedIn, you can find more hashtag recommendations after clicking on a hashtag. Choose the “Discover more hashtags” buttons after clicking on the ellipsis. 6.

How To Find Great Hashtags To Market Your Business, Twitter's native "trending topics" is limited to only a few hashtags, so if you want to find more outside of trending topics and you don't know what to  How to Create a Hashtag. A hashtag is a useful social media tool that helps to tag different posts as being related to the same topic. Hashtags are a great way to promote your idea, event, or brand on social media.

  • It only works for last hashtag in the textview. How can I make it mark all hashtags?
  • is there anyway to make it clickable too? I mean use it like a real <a> element in html
  • I got that but what is the procedure to find that from String title ?