Skip to main content

JS正则校验

let regex = /hello/;
let string = "hello world";
console.log(regex.test(string)); // 输出:true