better regular expressions for M, D, V, R, and P