Simple regex-based message template parser.