Regex to match Image Url

 ̄綄美尐妖づ 提交于 2019-12-05 17:57:24

do you mean:

if (!testRegex.test(imageUrl)) {
  alert('Not Match');
}

testRegex.test will evaluate to True if testRegex DOES match. ie

if (testRegex.test(imageUrl)) {
  alert('Match');
} else {
  alert('Not match');
}

You are missing ! in the if condition

if ( ! testRegex.test(imageUrl1) ) {
    alert('Not Match');
}

See http://jsfiddle.net/UgfKn/1/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!