var pattern1 = /好/g; console.log(pattern1.test("你好"));
字符串查找:
var pattern1 = /\w/; console.log(pattern1.test("njkhjkjk"));
空格查找:
var pattern1 = /\s/; console.log(pattern1.test("njkhjkjk"));
时间: 2024-11-08 20:04:59
var pattern1 = /好/g; console.log(pattern1.test("你好"));
字符串查找:
var pattern1 = /\w/; console.log(pattern1.test("njkhjkjk"));
空格查找:
var pattern1 = /\s/; console.log(pattern1.test("njkhjkjk"));