剑指offer-字符串-正则表达式匹配
正则表达式匹配
http://www.nowcoder.com/questionTerminal/45327ae22b7b413ea21df13ee7d6429c
function match(s, pattern) { let reg = new RegExp("^" + pattern + "$", "g"); return reg.test(s); }
正则表达式匹配
http://www.nowcoder.com/questionTerminal/45327ae22b7b413ea21df13ee7d6429c
function match(s, pattern) { let reg = new RegExp("^" + pattern + "$", "g"); return reg.test(s); }
相关推荐