import java.util.regex.*;
public class Regex1{
public static void main(String args[]) {
String str="For my money, the important thing "+
"about the meeting was bridge-building";
String regEx="a|f"; //表示a或f
Pattern p=Pattern.compile(regEx);
Matcher m=p.matcher(str);
boolean result=m.find();
System.out.println(result);
}
}
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/10896.html