fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4. import java.util.regex.Matcher;
  5. import java.util.regex.Pattern;
  6.  
  7. class Ideone
  8. {
  9. public static void main (String[] args) throws java.lang.Exception
  10. {
  11. final String regex = "(?<=pp_[^,]{0,1000}, )\\d+(?=])";
  12. final String string = "if (this.hostContainer) { try {\n"
  13. + "this.hostContainer.postMessage(['newPage', 'pp_3', 365]);\n"
  14. + "} catch(e) { console.println(e); }};";
  15.  
  16. final Pattern pattern = Pattern.compile(regex);
  17. final Matcher matcher = pattern.matcher(string);
  18.  
  19. System.out.println(matcher.group(0));
  20. }
  21. }
  22. }
Compilation error #stdin compilation error #stdout 0.13s 36892KB
stdin
Standard input is empty
compilation info
Main.java:22: error: class, interface, or enum expected
}
^
1 error
stdout
Standard output is empty