const value = 'I am a student. My age is 5';
const regex = new RegExp('\b' + value, 'i'); //what to add here?
console.log(regex.test('I am a student, my age is 5')); //true
console.log(regex.test('I am a student my age is 5')); //false
I want to ignore the ,
to make my second string to true.(我想忽略,
使第二个字符串为true。)
ask by Jennifer translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…