I hope to get URL from a string, how can I do it with jQuery ?
For example
Source: AAA http://www.google.com/
Target: http://www.google.com/
Source : http://www.msn.com/ This is a comment
Target: http://www.msn.com/
Source : BB http://www.twitter.com/ Good site
Target: http://www.twitter.com/
Source : Hello https://www.youtube.com
Target: https://www.youtube.com
Source : https://stackoverflow.com/74926284
Target: https://stackoverflow.com/74926284
2
Answers
You can use regex
You can take reference from here
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf