I have a string in java Select * from tbl_Name tn where tn.PublicID='?'and I am trying to find the occurrence of .PublicID='?' considering case insensitivity.
I am using below regex expression (?i).PublicID[ ]?=\'\?\', but it is not able to find any match in above string
Java Snippet used
String query = "";
if(queryOrTable.equalsIgnoreCase("Query"))
{
Pattern pattern = Pattern.compile("(?i).PublicID[ ]?=\\'\\?\\'");
Matcher matcher = pattern.matcher(tblName);
if(matcher.matches())
{
query = query.replaceAll("(?i).PublicID[ ]?=\\'\\?\\'", ".PublicID='" + publicID + "'");
}
else
{
System.out.println("malformed query");
}
}