Home  >  Article  >  Web Front-end  >  How can the url expression not be empty and determine whether the url complies with the rules? _html/css_WEB-ITnose

How can the url expression not be empty and determine whether the url complies with the rules? _html/css_WEB-ITnose

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

The following code can only determine whether the URL complies with the rules, but cannot determine whether it is empty. .
How to write it so that it can be judged that it cannot be empty and comply with the url rules.

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


Reply to discussion (solution)

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