fork download
  1. import java.util.regex.*;
  2.  
  3. class T {
  4. public static void main(String[] args) {
  5. Pattern p1 = Pattern.compile("\bcloud.*");
  6. Pattern p2 = Pattern.compile("\\bcloud.*");
  7.  
  8. Matcher m1 = p1.matcher("cloud (cloud.yahoo.com:225) - v0.00014 ( jan 10 1999 / 24:12:56 )");
  9. Matcher m2 = p2.matcher("cloud (cloud.yahoo.com:225) - v0.00014 ( jan 10 1999 / 24:12:56 )");
  10.  
  11. System.out.println(m1.matches());
  12. System.out.println(m2.matches());
  13.  
  14. }
  15. }
Success #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
false
true