url表达式怎么不能为空,又能判断url是否符合规则。_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:25:01
Original
1737 people have browsed it

下面的代码只能判断url是否符合规则,但是不能判断是否为空。。
怎么 写才能判断不能为空,又符合url规则。

	Url : /^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*$/,
Copy after login


回复讨论(解决方案)

var v=/\s/;alert(v.test("  "));alert(v.test("sdsd"));
Copy after login

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!