欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

Java 正则表达式最简单的例子,java正则表达式,import java.

来源: javaer 分享于  点击 38867 次 点评:133

Java 正则表达式最简单的例子,java正则表达式,import java.


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);       }}
相关栏目:

用户点评