The REST API does not validate the input string in a way that would prevent it from breaking the configuration serialization. Strings with an embedded newlines must be rejected.
The following regex
is a valid regex with comments enabled.
It should match "startend"
The Maxscale REST API allows creating of such regexes and they function as expected, but the resulting .cnf file ine "/var/lib/maxscale/maxscale/cnf.d/" is invalid, as it contains a new line.
The REST API returns the following JSON for this filter
The discrepancy between the json and .cnf representations means that after a maxscale restart the .cnf will be loaded and maxscale will crash as this is not a valid .cnf file