//查找
public static void main2(String[] args) {
String str="Tomy-tomy-ToMy-tomyMan-tomyWoman";
Pattern pattern=Pattern.compile("Tomy",Pattern.CASE_INSENSITIVE);
Matcher matcher=pattern.matcher(str);
while(matcher.find()){
System.out.println(matcher.start());
System.out.println(matcher.end());
System.out.println(matcher.group());
System.out.println("----------------");
}
}