fork(2) download
  1. import java.util.regex.Matcher;
  2. import java.util.regex.Pattern;
  3.  
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. String str = "0.0000";
  9.  
  10. Pattern p = Pattern.compile("(^-[0-9]+.+[0-9]*)|(^[0]+.+[0]+$)");
  11. Matcher m = p.matcher(str);
  12. if (m.find()) {
  13. System.out.println("False");
  14. }else{
  15. System.out.println("True");
  16. }
  17. }
  18. }
Success #stdin #stdout 0.07s 380224KB
stdin
Standard input is empty
stdout
False