var str=new RegExp("http"); console.log(str.test("https://www.wanjunshijie.com"))//test方法返回值为(true或者false) 喜欢