JS 利用正则表达式替换字符串 博客分类: JavaScript 学习资料 Java代码 收藏代码 JS 利用正则表达式替换字符串 var data = "123123,213,12312,312,3,Caat,cat,dsfsdfs,"; -])*t\b/ig; //•g(全文查找):•i(忽略大小写):•m(多行查找) var res = data.replace(reCat,"AAA"); 输出:,,,,,AAA,AAA,dsfsdfs, var data =…
public class Demo02 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = ""; System.out.println("请输入一个字符串"); s = sc.nextLine(); // System.out.println(checkQQ(s)); System.out.println(checkEmail(s));…