我有带有这些花哨双引号的文本:'“',我想使用 Ruby gsub 和正则表达式将它们替换为常规双引号。这是一个示例,以及到目前为止我所拥有的:
sentence = 'This is a quote, “Hey guys!”'
I couldn't figure out how to escape double quotes so I tried using 34.chr:
sentence.gsub("“",34.chr). This gets me close but leaves a back slash in front of the double quote:
sentence.gsub("“",34.chr) => 'This is a quote, \"Hey guys!”'