2021年12月29日

正则表达式专项练习

摘要: //匹配所有非英文字符String input = "$bo*y gi!r#l"; String mode = "[^a-zA-Z]";//注意亦或的符号在中括号里面 Pattern pattern = Pattern.compile(mode); String newStr = pattern.m 阅读全文

posted @ 2021-12-29 14:36 MaXianZhe 阅读(203) 评论(0) 推荐(0) 编辑

正则表达式

摘要: String input = "ABCD1234BCDE"; String mode = "BCD"; Pattern pattern = Pattern.compile(mode); int count = 0; Matcher matcher = pattern.matcher(input); 阅读全文

posted @ 2021-12-29 10:59 MaXianZhe 阅读(12) 评论(0) 推荐(0) 编辑

导航