fork(5) download
  1. import java.util.*;
  2. import java.util.regex.*;
  3. import java.lang.*;
  4.  
  5. class Main
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. Scanner in = new Scanner(System.in);
  10. String regex = in.next();
  11. String input = in.next();
  12.  
  13. Matcher m = Pattern.compile( regex ).matcher( input );
  14. System.out.println(m.lookingAt());
  15. for( int i=0, n=m.groupCount() ; i <= n; i++ )
  16. System.out.println(m.group(i));
  17. }
  18. }
Success #stdin #stdout 0.05s 246144KB
stdin
/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/([gim]+\b|\B)
/\s+/;
stdout
true
/\s+/
+