Javascript regex only matching entire url as typing
- by dt
I'm trying to use javascript to find all URLs in a textarea as the person is typing (onkeyup). The problem that I'm having is in finding a regex to match the entire URL, I need it only to match all the URL's in the text area that are complete URLs.
All of the existing regex expressions that I find through Google and through my own experiementing seem to match as soon as the user has typed the first part of the pattern. So, for example, if I'm typing and then start to type http://w, all of a sudden, it will match.
I need to find a regex that will match and return an array of all the urls that are in the textarea, while also not matching unless the person has completed typing the full URL. Hopefully that makes sense!
Thank you!