Trust me, I've gotten regular expressions to work in PostgreSQL before. The errors he is reporting have to do with the need to use a string and backslash things properly. You have to get past that before you get to find out what other errors you might have. So the interpolation issue notwithstanding, he was looking at the most relevant error message.
And you're right, I did add one q to one version of the code in my post. You'll note that I didn't do it on my first or my last version, and you'll note that I strongly recommended against using that version of the code.