正規表現 import java.util.regex.Pattern; import java.util.regex.Matcher; class Main { public static void main(String args[]) { { // 完全一致 Pattern pattern = Pattern.compile("^http://www\\."); Pattern pattern2 = Pattern.compile("abc", Pattern.CASE_INSENSITIVE); Matcher matcher = pattern.matcher("http://www.example.com"); Matcher matcher2 = pattern2.matcher("ABC"); System.out.println(matcher.matches()); /