regexRules() as $rule) { $pattern = (string) ($rule['pattern'] ?? ''); if ($pattern === '') { continue; } $matched = @preg_match($pattern, $content) === 1 || @preg_match($pattern, $normalized) === 1; if (! $matched) { continue; } $findings[] = [ 'rule' => 'regex_pattern', 'score' => (int) ($rule['weight'] ?? \app('config')->get('content_moderation.weights.regex_pattern', 30)), 'reason' => 'Matched custom moderation regex rule', 'links' => [], 'domains' => [], 'keywords' => [$pattern], ]; } return $findings; } }