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 = "(?i)(?<!\\S)like\\s*'%\".*?\"%'";
  12. final String string = "Select Count(distinct c.requestId) FROM Abc1Value c WHERE 1=1 and c.templateName is NULL AND (c.quickStatus IS NULL OR c.quickStatus = 'S') AND (c.sCode='MYCODE' OR exists (SELECT b.dseaReqId FROM drstSShareValue b WHERE b.dseaReqId=c.requestId and b.sCode='MYCODE')) AND (upper(c.licenseNo) like '%\"12548\"%' or upper(c.docLicenseNo) like '%\"\"%' or upper(c.uncontrolledLicense) like '%\"\"%' or upper(c.nonAuthNo) like '%\"\"%' or upper(c.reAuthNo) like '%\"\"%') and upper(c.grantedByCtryCode) like '%US%' ";
  13.  
  14. final Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE);
  15. final Matcher matcher = pattern.matcher(string);
  16.  
  17. while (matcher.find()) {
  18. System.out.println(matcher.group(0));
  19. }
  20. }
  21. }
Success #stdin #stdout 0.09s 33672KB
stdin
Standard input is empty
stdout
like '%"12548"%'
like '%""%'
like '%""%'
like '%""%'
like '%""%'