There are some other questions on this side addressing related issues, but I haven't found any which cover exactly my issue.
I have a text (converted from XML) which uses the apostrophe ' with three different meanings: Begin quote, end quote, and for abbreviations and genitive (can't, cats', etc.). Is there a way to keep the apostrophe ' the way it is in all cases but the begin quotes, where it must be replaced by `? For your information, I'm actually using XeLaTeX in my original document, but I'm not sure if it's going to matter.
\documentclass{memoir}
\begin{document}
He said, 'the cats' hats can't fit me'.
\end{document}
I guess the way of determining which one to use is:
- If the apostrophe is preceded by a text character, keep it
- If it is preceded by anything else (including space and nothing at all), change it to `
Note: Abbreviation apostrophes in the beginning of words (like in 'tis) are unlikely to appear in my documents.

csquotespackage, so that you end up with\somemacro{the cats' hats can't fit med}, which would give you a better structure plus the ability to control the quoting style from the preamble. – daleif Dec 21 '14 at 10:38\MakeOuterQuotefromcsquoteswould be the perfect solution if it in fact supported apostrophes. – Gaussler Dec 21 '14 at 10:45\MakeOuterQuotework on apostrophes if the apostrophe was made into an inactive character? In that case, how do you do that? – Gaussler Dec 21 '14 at 11:22