Java的正则表达式 Li.035
Java 的正则表达式Regex java.util.regex.Pattern 有正则表达示例 /* [abc] a, b, or c (simple class) abc中任意一个字符 [^abc] Any character except a, b, or c (negation) 非abc的一个字符 [a-zA-Z] a through z or A through Z, inclusive (range) 匹配a-z A-Z 大小写字符 [a-d[m-p]] a through d, or m through p: [a-dm-p] (union) 匹配a-d 和 匹配 m-p 字符, 匹配则true [a-z&&[def]] d, e, or f (intersection) 匹配def 与 a-z的并集是 def [a-z&&[^bc]] a through z, except for b and c: [ad-z] (subtraction), 非bc 和 a-z取并集(匹配a d-z字符) [a-z&&[^m-p]] a through z, and not m through p: [a-lq-z](subtraction), 非m-p字符与a-z取并集, 并集是a-l和q-z */ private static void Demo7() { String regex = "[a-z&&[^m-p]]"; System....