首页 > 其他 > 详细

学习笔记草稿

时间:2014-01-14 21:46:29      阅读:481      评论:0      收藏:0      [点我收藏+]

1、jquery

结束jquery中的$.each循环: return false

 

2、java 正则

bubuko.com,布布扣
import java.io.Console; 
import java.util.regex.Pattern; 
import java.util.regex.Matcher; 
 
public class RegexTestHarness { 
 
    public static void main(String[] args) { 
        Console console = System.console(); 
        if (console == null) { 
            System.err.println("No console."); 
            System.exit(1); 
        } 
       
        while (true) { 
            Pattern pattern = Pattern.compile(console.readLine("%nEnter your regex: ")); 
            Matcher matcher = pattern.matcher(console.readLine("Enter input string to search: ")); 
            boolean found = false; 
            while (matcher.find()) { 
                console.format("I found the text \"%s\" starting at index %d " + 
                        "and ending at index %d.%n", 
                        matcher.group(), matcher.start(), matcher.end()); 
                found = true; 
            } 
            if (!found) { 
                console.format("No match found.%n"); 
            } 
        } 
    } 
}
bubuko.com,布布扣

学习笔记草稿

原文:http://www.cnblogs.com/ccdc/p/3484840.html

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