If $R$ is regular local ring then $R$ is also Cohen-Macaulay ring and integral domain. I want to show that the converse is false.
I come up with this example.
Let $K$ be a field and $R=K[X,Y,Z]/(XY-Z^2)$, $M=(X,Y,Z)/(XY-Z^2)$ is the maximal ideal of $R$, $P=(X,Z)/(XY-Z^2)\subset M$ is the prime ideal in $R$. Because $K[X,Y,Z]$ is Cohen-Macaulay then so is $R$ (for $XY-Z^2$ is not zero-divisor) . Also, $(XY-Z^2)$ is irreducible element in UFD ring $K[X,Y,Z]$ so $R$ is integral domain.
Note that $htP=1$ hence $htP_M=1$. Now, $R_M$ is Cohen-Macaulay local domain (localization preserves Cohen-Macaulay property). If $R_M$ is regular local ring then by Auslander-Buchsbaum theorem it is UFD.
If I can show that $P_M$ is not principal ideal in $R_M$ then I get a needed contradiction and $R_M$ would be the perfect counterexample. But I stuck at this point so I'm looking for some helps.