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

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

WBOY
WBOYOriginal
2016-06-24 12:25:011739browse

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

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


回复讨论(解决方案)

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

Statement:
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