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
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]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*$/,
var v=/\s/;alert(v.test(" "));alert(v.test("sdsd"));