开发者

feed text parser

I'm getting text from an API and it's something like following:

text = 'replied to @james and he was visiting this http://some-site.com/another/something/../ so what you think about it';

How can I parse this text and make links as html links and @james as html links also, but with their own href values.

Does anyone 开发者_运维问答know any function that already does that or can someone paste their own function here please?


Depends on the language you are using (it's not clear from your question). But you can transform your links and @text into clickable URLs with regular expressions. This google search will point you in the right direction.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜