I want to include a regex in an array in JSON, like this:
"routes:before": {
"./middleware/foo": {
"enabled": false,
"paths": [/^\/(?!css|js|img).+$/ig] // <== doesn't work, throws
}
},
But it throws:
SyntaxError: \middleware.json: Unexpected token / in JSON at position 884
Although they say it is possible:
In addition to a literal string, route can be a path matching pattern, a regular expression, or an array including all these types.
What do I miss? How to pass a regex in an array in JSON?