Support Regex types with database-based configuration
Currently, some settings (e.g. for KeywordMRF or StealEmojiMRF) can handle both strings and Regex types via file-based configuration, which supports full Elixir code, and as such, Regex literals.
Issues arise when database-based configuration is involved, however: Regex types are not supported by this system. To workaround those issues, some settings accept strings instead, which are then either treated differently or compiled into Regex by the MRF. This causes two issues:
- for the former (strings are treated differently), this causes consequent behavioral differences between file-based configuration and database-based configuration, which can result in the impossibility to fully use some Pleroma features;
- and, for the latter (strings are compiled into Regex), this can cause heavier CPU load onto the system due to lack of caching, as well as needless code complexity increases.
As suggested by @lambadalambda on !3673 (merged), a type to wrap around the Regex type to target database-based configuration would be ideal, allowing them to be cached, serialized and de-serialized properly if needed.