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. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // String to be scanned to find the pattern.
  13. String line = "!!!Error deploying file order\\POST_ORDER_UpdateTaxAmountCurrInCo.sql at 22-JUL-16 08:07:Chathura aBhanakana1!!!Error deploying file order\\POST_ORDER_UpdateTaxAmountChathura aBhanakana1AAAAA !!!Error deploying file order\\POST";
  14. String pattern = "([\\s\\S]*?)(!!!Error deploying file)";
  15.  
  16. // Create a Pattern object
  17. Pattern r = Pattern.compile(pattern, Pattern.MULTILINE);
  18.  
  19. // Now create matcher object.
  20. Matcher m = r.matcher(line);
  21. while (m.find( )) {
  22. String str = m.group(1);
  23. if(str != null && !str.isEmpty()){
  24. System.out.println("Found value: " + str );
  25. }
  26. }
  27. }
  28. }
Success #stdin #stdout 0.1s 320512KB
stdin
Standard input is empty
stdout
Found value:  order\POST_ORDER_UpdateTaxAmountCurrInCo.sql at 22-JUL-16 08:07:Chathura aBhanakana1
Found value:  order\POST_ORDER_UpdateTaxAmountChathura aBhanakana1AAAAA