fork download
  1. import java.util.regex.Pattern;
  2.  
  3. public class Main {
  4. public static void main(String[] args) {
  5. Pattern p = Pattern.compile("casa", Pattern.CASE_INSENSITIVE);
  6. System.out.println(p.matcher("Casa").matches());
  7. System.out.println(p.matcher("CaSa").matches());
  8. System.out.println(p.matcher("CAsA").matches());
  9. System.out.println(p.matcher("casa").matches());
  10. System.out.println(p.matcher("CaSA").matches());
  11. System.out.println(p.matcher("Sopa").matches());
  12. System.out.println(p.matcher("Carro").matches());
  13. System.out.println(p.matcher("Verde").matches());
  14. }
  15. }
Success #stdin #stdout 0.04s 711168KB
stdin
Standard input is empty
stdout
true
true
true
true
true
false
false
false