I have three regular expression:
Pattern mentionPattern = Pattern.compile("(@[A-Za-z0-9_-]+)");
Pattern hashtagPattern = Pattern.compile("(#[A-Za-z0-9_-]+)");
Pattern urlPattern = Patterns.WEB_URL;
I have a string :
This is a #sample #twitter text of @tom_cruise with a link http://tom_cruise.me
I need to match this text with the above three regular expression and color the matched text with Blue and set the final text in a TextView
. How can I achieve that?
It is to be mentioned that I don't need to Linkify
the text, only coloring. And I am not using Twitter4j
Library.