fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. //全角英数字チェック
  11. private static boolean zenkakucheck(String value) {
  12. if(value.matches("*/[0-9A-Za-z]*/"))
  13. return false;
  14. return true;
  15. }
  16. public static void main (String[] args) throws java.lang.Exception
  17. {
  18. System.out.println(zenkakucheck("86"));
  19. System.out.println(zenkakucheck("86"));
  20. System.out.println(zenkakucheck("86"));
  21. System.out.println(zenkakucheck("86"));
  22. }
  23. }
Runtime error #stdin #stdout #stderr 0.09s 47724KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Exception in thread "main" java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0
*/[0-9A-Za-z]*/
^
	at java.base/java.util.regex.Pattern.error(Pattern.java:2015)
	at java.base/java.util.regex.Pattern.sequence(Pattern.java:2190)
	at java.base/java.util.regex.Pattern.expr(Pattern.java:2056)
	at java.base/java.util.regex.Pattern.compile(Pattern.java:1778)
	at java.base/java.util.regex.Pattern.<init>(Pattern.java:1427)
	at java.base/java.util.regex.Pattern.compile(Pattern.java:1068)
	at java.base/java.util.regex.Pattern.matches(Pattern.java:1173)
	at java.base/java.lang.String.matches(String.java:2033)
	at Ideone.zenkakucheck(Main.java:12)
	at Ideone.main(Main.java:18)