Java Regex for matching quoted string with escaped quotes
- by kayahr
I know there are already many questions like mine but I found no answer which works in Java. So I write a new question.
I have text files with content like this:
key1 = "This is a \"test\" text with escapes using '\\' characters";
key2 = 'It must work with \'single\' quotes and "double" quotes';
I need a regular expression which matches the values in the double-quotes (or single-quotes). This regular expression must support the escaped quotes and escaped backslashes.
The regular expression must work with Java standard Pattern/Matcher classes.