lets say the text area contains,
http://site1.com/uri/
http://site2.net/uri
http://site3.org/uri
http://site4.co.uk/uri
http://site5.ws/uri
The first thing i would do is bind an even for keyup on the textarea
$('#addLinks').bind('keyup',function(){
var _data = $(this).val();
//Then i would try and split the spaces and carriages
_array = _data.split('\n|\r\n|\s|,'); //Split by returns,new lines,spaces,commas.
var _regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
$(_array).each(function(value){
//Now i will check the URL is valid
if(_regex.test(value))
{
//Valid URL so i will then append it to the links container
//Here you can do e
$('<a></a>').attr('href',value).val(value).appendTo('.linksContainer');
}
})
});
Something along them lines!
Regex borrowed from: http://snippets.dzone.com/posts/show/452