I am looking for regex to return value between the double quotes in a given string. I am using below java code
Pattern p = Pattern.compile("\"([^\"]*)\"");
Matcher m = p.matcher(line);
int findline = 0;
while (m.find()) {
System.out.println(m.group(0));
}
The above code work fine for normal text but not for below string
String originalString ="value = value.replaceAll(", ", ",").replaceAll(",", "\",\"").replaceAll("\\[","\""); ";
On javafile it will be like
String originalString = "value = value.replaceAll(\", \", \",\").replaceAll(\",\", \"\\\",\\\"\").replaceAll(\"\\\\[\",\"\\\"\"); ";
Now what i am looking for is if the data between double quote contain
\ or \" or \\
then ignore that rest everything it should return.
Rest all value between double quote contain escape char so ignore that content.