I *think* it's correct that you ignore the 'm' flag from the server, but send the 'm' flag to the server when encoding a Regex with the 's' flag? There's no perfect answer, and I think you found the right one.