Разделение по регулярному выражению URL (спасибо @Pullet за указание на недостаток):
var urlPattern = /(https?\:\/\/\S+[^\.\s+])/;
someText.split(urlPattern);
Давайте разберем регулярное выражение:)
(https? -> has "http", and an optional "s"
\:\/\/ -> followed by ://
\S+ -> followed by "contiguous" non-whitespace characters (\S+)
[^\.\s+]) -> *except* the first ".", or a series of whitespace characters (\s+)
Выполнение вашего образца текстат,
["I am some text and check this out! ",
"http://blah.tld/foo/bar",
" Oh yeah! look at this too: ",
"http://foobar.baz",
""]