I want to find the string inside double quotes or single quotes in a text file(the text file is multiline),
for example:
I have a test "foo bar1" test2 "foo\"bar2", "foo 'bar3", 'foo bar4', 'foo \'bar5', 'foo "bar6', It will output
foo bar1 foo\"bar2 foo 'bar3 foo bar4 foo \'bar5 foo "bar6 the hard point is:
- The text file is multiline.
- It may have escaped double or single quotes inside quotes.
- The double quotes may have single quotes inside.
- The single quotes may have double quotes inside.
- The quotes must be paired match.
,and,can be replaced by newline? And after this replacement there can be only one element per line?,, the seperator can be others."and'. Can there be quoted\, too? I guess noone will feel like writing a parser for all possible kinds of input."and'.