I have about 20.000 quotation marks in my project. I want to automatically replace them based on the content. For simplicity, let's consider that it's all double quotes.
If the characters inbetween quotes are all CAPS, then it should be a single quote and else, it should be double quotes.
I figured that the best way to do this would be using regular expressions, but I don't know how. I'm grateful for any help.
(Python in VSCode)
CodePudding user response:
Try
Find: "([A-Z .] )"
Replace: '$1'
CodePudding user response:
- Replace all quotes to double quotes..
- Use this regex to find and replace all quotes to single quotes
/(["])[A-Z] (["])/
Read regex docs https://docs.python.org/3/library/re.html