I'm trying to match special kind of string literals with some funky escaping rules.
The general form looks like this:
"some string" Which are simple to match using a pattern such as "(.*?)"
However you can escape quotes by doubling them, such as:
"hello "" there" becomes hello " there
"hello """" there" becomes hello "" there
And this is where my regex skills fail me. How can I match strings like this?
Oh, and I'm using python 3.1.
"hello "" there"and"hello """" there"and want the output to behello " thereandhello "" thererespectively or?"""? Can you match the string first and then replace the quotes?