fork(12) download
  1. class Main
  2. {
  3. public static void main (String[] args) throws java.lang.Exception
  4. {
  5. String name = "maze1.in";
  6. if( name.matches("\\w+\\d+\\.\\w+") ) {
  7. System.out.println("Matched generic regex!.");
  8. }
  9.  
  10. if( name.matches("maze\\d\\.in") ) {
  11. System.out.println("Matched specific regex!.");
  12. }
  13. }
  14. }
Success #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
Matched generic regex!.
Matched specific regex!.