Chat View auto detect Links/Url in a message

I am creating a Chat App

  • I want that if a user types/paste any link/Ural (eg:https://creator.kodular.io/) in the chat message. The
    Chat Message (that contains the Ural/Links) automatically change colour to blue

  • And also When the Ural/Link is clicked it open in Chrome Custom Tab/Web Viewer just like
    WhatsApp or Telegram.

Is that possible and if then how?

Two Questions

  1. How to change text colour to blue if it contains Links/Ural
  2. How to make links Clickable (ie: When a link is clicked it open in Web Viewer or Chrome Custom Tab)

Any other suggestion to make a better Chat App is Highly Appreciated

Thanks for answering

Use regular expression extension to detect if a sentence contains URLs. Seach Regex in taifun extension directory

1 Like

I didn’t get it. If you can explain with some blocks, how it gonna help me.

That would be great.

Thanks

https://www.kevinkun.cn/regex.html
download the ext here

2 Likes

An example

5 Likes

Pls post the pattern again, in the block the pattern is not complete

[(http(s)?):\/\/(www\.)?a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)
2 Likes

If there are multiple links then This method will work or not?
@dora_paz

Why won’t you try it ?

1 Like