Convert string to regex when required

When data is sent in `JSON`, strings must be used.
This convert these to `regex`es automatically.