Could you make this return a value instead of mutate a string?

```
regex_str = regex_str.gsub '%M', '(?<major>\d+)'.
                                gsub '%m', '(?<minor>\d+)'.
   ...
```
The more pure the function application, the better. (I've been bitten by string instances mutating when I've assumed they're immutable)