转义符号 vs 转义字符

\n、\r、\t

RegExp (regular expression)

修饰符

i

var reg = new RegExp('Test', 'i'),
    str = 'This is a test';

console.log(reg.test(str)); // true
var reg = new RegExp('Test', 'i'),
    str = 'This is a test, Test is important';

console.log(str.match(reg));

Untitled