Using Regex Replace when looking for un-escaped characters
- by Daniel Hollinrake
I've got a requirement that is basically this. If I have a string of text such as
"There once was an 'ugly' duckling but it could
never have been \'Scarlett\' Johansen"
then I'd like to match the quotes that haven't already been escaped. These would be the ones around 'ugly' not the ones around 'Scarlett'.
I've spent quite a while on this…