There are two situations: you are using so-called
“smart quotes” (default) or you have
"regular quotes" (you disabled Word's automatic replacement of quotes for smartquotes). In either case, ensure that the options to ignore punctuation and whitespace are not enabled in the find and replace dialog!
I am using Word 2019 on the Mac so will use the mac's Option-key method to input the special characters in the instructions. On Windows, to type the special characters, hold down the Alt key and type a number on the numeric keypad: Alt+0145 and Alt+0146 for opening (
‘) and closing (
’) single-quotes, and Alt+0147 and Alt+0148 for opening (
“) and closing (
”) double-quotes. For the guillements, use Alt+174 for (
«) and Alt+175 for (
»). If you do not have a numeric keypad, use the character map utility (search for charmap in the start menu) In a Linux/Mac terminal, you can generate all these characters with
For situation one: in the find and replace dialog, type Option+[ for opening double-smartquote (
“) or Option+] for opening single smartquote (
‘) and then in the replace field type Option+\ for opening guillement (
«), appending a space as needed. You could also copy and paste from the document to get these special characters. This will take care of the opening quotes. Do the same for the closing ones using Option+Shift+[ (
”) and Option+Shift+] (
’) to search for the closing smartquotes and replace with Option+Shift+\ (
») (prepend a space as needed) for the closing guillement.
For situation two: use the advanced find and replace dialog and enable the "use wildcards" checkbox. We need to use regular expressions (regex) to differentiate between an opening and closing quotation mark since they are the same actual character. For opening double-quotes, use
"([a-zA-Z0-9]) and for opening single-quotes, use:
'([a-zA-Z0-9]). In the replace box, for both, use:
« \1. For the closing double-quotes and single-quotes, use
([a-zA-Z0-9.,\!‽\?])' respectively in the find field and put,
\1 » in the replace field. Read on for an explanation of these special search strings.
As a brief primer of regex, anything within parenthesis is captured into a numbered memory location and you recall that memory with \n The first paren maps to \1, the second to \2, etc... The square brackets are sort of a
? wildcard on steroids: instead of matching any one character, you can define exactly what characters match. Ranges are supported and here, you can see that we are matching (and storing) any alphanumeric character, upper or lower-case for the opening quotes. For closing quotes, we add certain punctuation which typically precede closing quotes. Note that the exclamation and question marks both are special characters in regex and so they are preceded by the backslash to indicate matching the actual character
?. You may be unfamiliar with the interrobang character which denotes an exclamatory question; it is not a special character in regex and so doesn't need the backslash.