Extract urls from a text

Hello All,

I have a scenario where i want to extract the url’s present inside a text how can i achieve this.
ex: hello this is an sample input text “https:blank.com” hello this is bot here is my url "https:url2.com

so this is my sample input text and i want to extract two of the above urls only how can i achieve this

thanks,

Hi @sanjay_gowda

You can use this:


(https):([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])

And if the URL has something like https://url2.com

Then please use

(http|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.