首页 > 编程语言 > 详细

java正则表达式

时间:2016-07-12 11:54:45      阅读:179      评论:0      收藏:0      [点我收藏+]

// java 两个重要的类。

java.util.regex.Pattern; //规则 。

java.util.regex.Matcher;//匹配

Pattern p = Pattern.compile(REGEX);

Matcher m = p.matcher(INPUT); // 获取 matcher 对象

int count = 0;

while(m.find())

{

count++;

System.out.println("Match number "+count);

System.out.println("start(): "+m.start());

System.out.println("end(): "+m.end());

}

java正则表达式

原文:http://www.cnblogs.com/zxf330301/p/5662807.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!