I am creating a text heavy game and the text-based content currently has non-smart (“, ‘) quotation marks but we want there to be smart (“, ”, ‘, ’) quotation marks. I hard programmed a loop to do this conversion during runtime but a regex approach could be far more suitable than my hefty loop. I’ve found it quite difficult to generate any good regular expressions (given a general lack of skill in the regex department).
An example conversion would be:
“TEXT ‘TEXT “‘TEXT’ TEXT”‘ TEXT.” “TEXT TEX’T
Becomes:
“TEXT ‘TEXT “‘TEXT’ TEXT”’ TEXT.” “TEXT TEX’T
How should I go about creating code for this conversion?