It is necessary to turn all inserted links into hyperlinks (like VC).

I can not find a suitable regexp, after the link there can be a dot, a bracket, something else that the user comes up with. What I found, captured these characters for the company.

    1 answer 1

    The task is practically impracticable, since according to the specification in the URL can be a variety of characters, and reliably distinguish where the URL, and where the text is, is impossible.

    However, as an option:

    /((?:(?:https?):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:;,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:;,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:;,.]*\)|[A-Z0-9+&@#\/%=~_|$]))/ig 

    DEMO: JSFiddle