Not sure if I'm doing this right:
/(https?:\/\/\S+)(\s|(& nbsp;))?/g;
This should match a URL beginning with http(s):// and ending with a space character or a & nbsp;
So the problem is this part:
(\s|(& nbsp;))?
That should mean: match either a white space or a & nbsp; but it doesn't work. It never matches for a & nbsp; and just continues until it finds a white space.
I'm not looking for any other http regexp, I'm not looking for a javascript library solution, I'm happy with this, I just want to figure out that last portion.
Edit: some kind of bug in the code formatting on this site, there isn't a space between & and nbsp; but this site turns it into a space if I get rid of that separating space.