function searchURL(str:String) { indexStart=str.indexOf('www',0); if (indexStart>=0) { indexStop=str.indexOf(' ',indexStart)-indexStart; return substring(str,++indexStart,indexStop); } else return undefined; } url=searchURL(str);