Skip to main content
Glama

CTX: Context as Code (CaC) tool

by context-hub
MIT License
235
  • Apple
  • Linux
RegexReplacementRule.php845 B
<?php declare(strict_types=1); namespace Butschster\ContextGenerator\Modifier\Sanitizer\Rule; /** * Rule for replacing content using regular expressions */ final readonly class RegexReplacementRule implements RuleInterface { /** * @param string $name Unique rule name * @param array<string, string> $patterns Array of regex patterns and their replacements */ public function __construct( private string $name, private array $patterns, ) {} public function getName(): string { return $this->name; } public function apply(string $content): string { foreach ($this->patterns as $pattern => $replacement) { /** @var string $content */ $content = \preg_replace($pattern, $replacement, $content); } return $content; } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/context-hub/generator'

If you have feedback or need assistance with the MCP directory API, please join our Discord server