I would like to do something similar on Android:
from:
*foo* bar*stuff*
dest:
<b>foo</b> bar<b>stuff</b>
In C# I created Regex and replaced:
string text = "*foo* bar*stuff*"; Regex bold = new Regex(@"\*(.+?)\*", RegexOptions.Singleline); html = bold.Replace(html, new MatchEvaluator(p => string.Format("<b>{0}</b>", p.Groups[1].Value)));
I read the Android java.util.regex.Matcher documentation , and it says the replace() method replaces all the matching with a string (constant). Is there a way to replace each occurrence with a link to this event group?
source share