how to detect and get url on string javascript?
example :
var string = "hei dude, check this link http:://google.com and http:://youtube.com"
how to get result like this from my string :
var result = ["http:://google.com", "http:://youtube.com"]
how do that?
You input has double
::
afterhttp
. Not sure if it intentional. If it is then use:If only one
:
is needed then use:RegEx Demo