fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.regex.Matcher;
  4. import java.util.regex.Pattern;
  5.  
  6. /* Name of the class has to be "Main" only if the class is public. */
  7. class Ideone
  8. {
  9. public static void main (String[] args) throws java.lang.Exception
  10. {
  11. Pattern pattern = Pattern.compile("^[A-Z]{3}\\d[A-Z]\\d{2}$");
  12. Matcher matcher = pattern.matcher("AAA3B11");
  13.  
  14. System.out.println( matcher.find() );
  15. }
  16. }
Success #stdin #stdout 0.04s 2184192KB
stdin
Standard input is empty
stdout
true