📅  最后修改于: 2022-03-11 15:03:07.132000             🧑  作者: Mango
const str = 'hello world!';
const result = /^hello/.test(str);
console.log(result); // true
/**
The test() method executes a search for a match between
a regular expression and a specified string
*/