预定义类:
边界:
举例:
var a = "@one
@two
@three
";
a.replace(/^@/g,"#");
#one
@two
@three
虽然 是一个字符串 但是将换行符解析成空格字符不是换行符 , m 多行解析
a.replace(/^@/gm,‘#‘);
‘@[email protected]@3‘.replace(/[email protected]/g,‘123‘);
"@1231233"
‘@[email protected]@3‘.replace(/@./g,‘123‘);
"123123123"
‘@[email protected]@3‘.replace(/^@/g,‘123‘);
"[email protected]@3"
时间: 2024-10-23 05:16:58