import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
 
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
	// String to be scanned to find the pattern.
      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";
      String pattern = "([\\s\\S]*?)(!!!Error deploying file)";
 
      // Create a Pattern object
      Pattern r = Pattern.compile(pattern, Pattern.MULTILINE);
 
      // Now create matcher object.
      Matcher m = r.matcher(line);
      while (m.find( )) {
      	String str = m.group(1);
         if(str != null && !str.isEmpty()){
         	System.out.println("Found value: " + str );
         }
      } 
	}
}