早睡早起,方能养生
Sleep early rise early, way to keep healthy

js正则表达式匹配网址url

super
2022-10-04 12:24
views 293

let parse_url = /^(http|https|ftp):\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*$/;
if (parse_url.test('https://www.rongsp.com')) {
	alert('格式正确');
} else {
	alert('格式不正确');
}


分享
0 条讨论
top