My file contains some lines such as
"This is a string." = "This is a string's content."
" Another \" example \"" = " New example."
"My string
can have several lines." = "My string can have several lines."
I need to extract the substring :
This is a string.
This is a string's content.
Another \" example \"
New example.
My string
can have several lines.
My string can have several lines.
Here's my code:
String regex = "\".*?\"\\s*?=\\s*?\".*?\"";
Pattern pattern = Pattern.compile(regex,Pattern.DOTALL);
Matcher matcher = pattern.matcher(file);
For the moment, I can get the pair of left and right part of "=". But when my substring contains " \" ", my regex dosen't do the right job.
Can anyone help me write the correct regex please ? I tried \"^[\\"] instead of \", but it didn't work..
Thanks advance.