itstrive / striveCode

some demo and js Knowledge points records :cn: :cloud: :snowflake:
108 stars 83 forks source link

正则题目 #6

Open itstrive opened 6 years ago

itstrive commented 6 years ago
var str='welcome';

console.log(/^^^^welcome$$$/.test(str));  // 答案是多少为什么?
console.log(str.replace(/(?=l)/g,'#'));  //答案为?
console.log(str.replace(/(?!l)/g,'#'));   // 答案为?