Here is a Stack overflow post with javascript regex solution for this problem.

http://stackoverflow.com/questions/1353408/messageformat-in-javascript-parameters-in-localized-ui-strings