[Regex] How to recognise links from dynamic text in html element

I want to mimic this:
https://puu.sh/CLef5.png

https://puu.sh/CLjtl.png
when comment’s text:extract with regex

^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$

count is 0


make changes to comment’s text
https://puu.sh/CLjwZ.png

(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:[\]@!\$&'\(\)\*\+,;=.]

replace by

https://$&

2 Likes

This topic was automatically closed after 70 days. New replies are no longer allowed.