fork download
  1. import java.util.regex.Matcher;
  2. import java.util.regex.Pattern;
  3.  
  4. public class Main {
  5.  
  6. public static void main(String[] args) {
  7. String text = "Library Catalogue Log off | Borrower record | Course Reading | "
  8. + "Collections | A-Z E-Journal list | ILL Request | Help Browse | Search "
  9. + "| Results List | Previous Searches | My e-Shelf | Self-Issue | Feedback "
  10. + "Selected records: View Selected | Save/Mail | Create Subset | "
  11. + "Add to My e-Shelf | Whole set: Select All | Deselect | "
  12. + "Rank | Refine | Filter Records 1 - 15 of 101005 "
  13. + "(maximum display and sort is 2500 records) "
  14. + "1 Drower, E. S. (Ethel Stefana), Lady, b. 1879. Lady E.S. "
  15. + "Drower’s scholarly correspondence : an intrepid English autodidact in Iraq / edited by 2012. "
  16. + "BK Book University Library( 1/ 0) "
  17. + "2 Kowalski, Robin M. Cyberbullying : bullying in the digital "
  18. + "age / Robin M. Kowalski, Susan P. Limber, Patricia W. Ag 2012. BK Book University Library( 1/ 0)"
  19. + " ... 15 Ambrose, Gavin. Approach and language [electronic resource] "
  20. + "/ Gavin Ambrose, Nigel Aono-Billson. 2011. BK Book";
  21.  
  22. Pattern p = Pattern.compile("((1 Drower.+Iraq).+0\\)).+2 Kowalski");
  23. Matcher m = p.matcher(text);
  24. if (m.find()) {
  25. System.out.println(m.group(1));
  26. System.out.println(m.group(2));
  27. }
  28. }
  29. }
Success #stdin #stdout 0.08s 212736KB
stdin
Standard input is empty
stdout
1 Drower, E. S. (Ethel Stefana), Lady, b. 1879. Lady E.S. Drower’s scholarly correspondence : an intrepid English autodidact in Iraq / edited by 2012. BK Book University Library( 1/ 0)
1 Drower, E. S. (Ethel Stefana), Lady, b. 1879. Lady E.S. Drower’s scholarly correspondence : an intrepid English autodidact in Iraq