var reg = '[a-zA-z]+://[^\s]*';//正则var url = $('#add [name=notice_url]').val();if(url.length >0){ var reg_test = new RegExp(reg); var result = reg_test.test(url); if(result != 1){ PopAlert('地址填写错误'); return; }}