I am going to implement regex to catch url in strin. To do so, I have wrote regex expression but it only captures sub-part of expected input not all. How can I fix it so that it can catch all of the expected input and mark them as url?
expected input
ftp://joe:password@ftp.filetransferprotocal.com
http://www.google.com/search?q=good+url+regex&rls=com.microsoft:*&ie=UTF-8&oe=UTF-8&startIndex=&startPage=1
https://some-url.com?query=&name=joe?filter=.#some_anchor
www.some-url.com?query=&name=joe?filter=.#some_anchor
www.some-url.edu?query=&name=joe?filter=.#some_anchor
www.some-url.gov?query=&name=joe?filter=.#some_anchor
www.some-url.co.uk?query=&name=joe?filter=.#some_anchor
www.some-url.xxx?query=&name=joe?filter=.#some_anchor
ww2.some-url.com?query=&name=joe?filter=.#some_anchor
http://en.wikipedia.org/wiki/Björn_Andrésen
my code is \(?\bhttp://[-A-Za-z0-9+&@#/%?=~_()|!:,.;]*[-A-Za-z0-9+&@#/%=~_()|]