views:

30

answers:

1

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?

+1  A: 

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.

Jan Hančič