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");
			}
		}
	}
}
最近下载更多
                
                smiledog     LV2
                2021年1月29日
            
            
        
                pyg123456     LV1
                2020年12月29日
            
            
        
                luohaipeng     LV23
                2019年11月20日
            
            
        
                helenjiang     LV1
                2019年8月21日
            
            
        
                低调人     LV38
                2019年8月4日
            
            
        
                yyyyyyyyyyyyyyyyyyy     LV16
                2019年7月3日
            
            
        
                silenceS     LV4
                2018年10月5日
            
            
        
                tztony     LV1
                2018年7月11日
            
            
        
                free2322222223     LV1
                2018年7月3日
            
            
        
                zhuozhi     LV2
                2018年4月29日
            
            
        
最近浏览更多
                
                NeneAnegsaki     LV2
                2022年4月24日
            
            
        
                yiyiyi55555     LV1
                2021年10月22日
            
            
        
                金玉博     LV1
                2021年9月6日
            
            
        
                smiledog     LV2
                2021年1月29日
            
            
        
                yuzhiyuan1977     LV2
                2021年1月5日
            
            
        
                pyg123456     LV1
                2020年12月29日
            
            
        
                LiXin1994     LV1
                2020年12月9日
            
            
        
                gan857569302     LV9
                2020年6月23日
            
            
        
                lichengai     LV7
                2020年5月1日
            
            
        
                luohaipeng     LV23
                2019年11月20日
            
            
        
                
                
                