下面简单的说下它的4种常用功能: 查询: String str="abc efg ABC"; String regEx="a|f"; //表示a或f Pattern p=Pattern.compile(regEx); Matcher m=p.matcher(str); boolean rs=m.find();