Currently, EditPage::matchSpamRegex, EditPage::matchSummarySpamRegex, and EditPage::matchSpamRegexInternal are used to compare the content and summary of an edit to the global wgSpamRegex and wgSummarySpamRegex. The methods are static, and they access the globals directly.
The use of global variables is discouraged (c.f. https://www.mediawiki.org/wiki/Manual:Wg_variable) and these methods are used outside of the EditPage class (MergeHistory, MovePage, and SpecialChangeContentModel in core, and SpecialNewsletter in MediaWiki-extensions-Newsletter, all use matchSummarySpamRegex to check summaries). I propose a new SpamRegexChecker service, that will be part of the backend for EditPage but can also be used elsewhere were needed. It'll have two methods, one for checking against wgSpamRegex, and the other for wgSummarySpamRegex, with those configuration values injected rather than accessed via the global scope.