fork(1) download
  1. import java.util.*;
  2. import java.util.regex.*;
  3.  
  4.  
  5. class rTest {
  6. public static void main (String[] args) {
  7.  
  8.  
  9. String s = "i installed apache2 and when i transfered the httpd.conf to the new structure";
  10. Pattern p = Pattern.compile("(?s)(?=(i.*?structure))");
  11. Matcher m = p.matcher(s);
  12.  
  13. List<String> matches = new ArrayList<>();
  14.  
  15. while (m.find()) {
  16. matches.add(m.group(1));
  17. }
  18.  
  19. System.out.println(matches);
  20.  
  21. }
  22. }
Success #stdin #stdout 0.09s 321344KB
stdin
Standard input is empty
stdout
[i installed apache2 and when i transfered the httpd.conf to the new structure, installed apache2 and when i transfered the httpd.conf to the new structure, i transfered the httpd.conf to the new structure]