I am trying to take a string of text and create an array from it so that the string:
var someText='I am some text and check this out! http://blah.tld/foo/bar Oh yeah! look at this too: http://foobar.baz';
insert magical regex here and
the array would look like this:
theArray[0]='I am some text and check this out! '
theArray[1]='http://blah.tld/foo/bar'
theArray[2]=' Oh yeah! look at this too: '
theArray[3]='http://foobar.baz'
I’m at a loss, any help would greatly be appreciated
–Eric
Split by URL regex (thanks to @Pullet for pointing out a flaw here):
Let’s break down the regex 🙂
Running through your sample text gives,