I am creating an asp.net mvc application, where there is a text box where users can type text which may include some urls, on server i want to parse that text and extract all urls avable in it.
possible text
abc.com, xyz.com, http://foo.com
baar.com
http://baz.com, www.foobar.com
mosso.com
http://subfoo.foo.com
bar.baz.com
foobar.net baaz2.com morebaaz.com
Expected Output array
abc.com
xyz.com
foo.com
baar.com
baz.com
foobar.com
mosso.com
subfoo.foo.com
bar.baz.com
foobar.net
baaz2.com
morebaaz.com
How about this:
Then you can check each string for a valid url
Hope it helps…
EDIT: Sorry, the validation failed..Fixed it now…