in reply to Re^2: Parsing using m//g
in thread Parsing using m//g

Simply change /.../xmsg to /.../xsg.
and/or
Simply change $ to \z.

Update: Added the second (and better) option.